logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 03-26-2010, 07:24 PM   #1
nits4u
 
Join Date: Jun 2009
Posts: 133
Default a veryyyy basic image gallery !!

guys i tried to make a very basic image gallery, having left and right links to switch the images. thats it,

i am newbie to js, so try to do it by myself. Here is the code, which is not working:

<html>
<head>
<title></title>
</head>
<body>
<img src="" id="img" />
<a id="lt" href="" onclick="left()">left</a>
<a id="rt" href="" onclick="right()">right</a>
<script type="text/javascript">
var ary1 = ["rcurv.gif","lcurv.gif","midl.gif","plus.gif"];
var num=0;
function right(){
document.getElementById('img').src=ary1[num++];
}
function left(){
document.getElementById('img').src=ary1[num--];
}
</script>
</body>
</html>
nits4u is offline   Reply With Quote
Old 03-26-2010, 10:18 PM   #2
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

I would grab something like the jQuery Cycle plugin. Makes JS much easier for newbies.
domedia is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com