Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to cycle between images on mouse click

 
Gerard Largosa
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to cycle between images when an image is clicked? I see code samples but the code uses dropdowns or buttons. I want the user to click the image itself. I have tried modifying existing code which uses dropdowns and bottons, but have been unsuccesfull so far. Any help is appreciated. Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put an onclick handler on the image that triggers the Javascript function that swaps in the next image.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic