Hi All,
I want to create a carousel where if the user press prev and next only the image and its associated text should be displayed. Like for first item that is Image1, This is Image1 text should be displayed then if the user presses next Image2 and This is Image2 should be displayed.
Below is my code
Thanks
<html>
<head>
<style>
#container p{ display: inline; }
</style>
<script type="text/javascript" src="prototype.js" > </script>
</head>
<body>
<div id="container">
<div id="section1">
<img src="images/image1.jpg" height="20" width="20" />
<p> This is a image1 </p>
</div>
<div id="section2">
<img src="images/image1.jpg" height="20" width="20" />
<p> This is a image2 </p>
</div>
<div id="section3">
<img src="images/image1.jpg" height="20" width="20" />
<p> This is a image3 </p>
</div>
<a id="prev" href="#">Prev</a>
<a id="next" href="#">Next</a>
</div>
<script type="text/javascript">
Event.observe('prev', 'click', function(event){
alert(' Prev clicked!');
});
Event.observe('next', 'click', function(event){
alert(' Next clicked!');
});
$('section1').hide();
</script>
</body>
</html>