Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   very simple image gallery !!! (http://www.go4expert.com/forums/simple-image-gallery-t21550/)

gsingla4u 27Mar2010 19:54

very simple image gallery !!!
 
guys i try 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:
Code:

<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>

Please help me with the code. :)

gsingla4u 27Mar2010 22:29

Re: very simple image gallery !!!
 
no reply !!! ?


All times are GMT +5.5. The time now is 05:18.