Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a image slider in my form.so next and prev button in slider but i want to when i mouse click on image to change next image .my image slider works next and prv image display.so how to do my requriement. plz give me suggestion.
thanks,
MS.
Posted

Hi,

You could try the same next button click function in the image to do the same.
It will automatically trigger the function then next image will be displayed if image is clicked

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
you can try this:

XML
<script type="text/javascript">
imgs=Array("img1.jpg","pic2.jpg","another.jpg","whee.gif","whatever.png");
var x=0;

function change() {
document.getElementById("bob").src=imgs[++x];

if (x==5) {
x=0;
}
}
</script>

<img src="img1.jpg" id="bob" alt="" onmousedown="change()">


You can check similar questions here: http://www.c-sharpcorner.com/Forums/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900