simple image slider in jquery -


i found code 'image slider' on site, i'm trying change suit needs. want able step through 3 or 4 image files, i'll settle two, until code sorted.

could me fix code? have 2 images, img1_on.png , img2_on.png.

<img id ="rotate_images" src="img1_on.png"/>  $('rotate_images').on({     'click': function() {          var src = ($(this).attr('src') === 'img1_on.png')             ? 'img2_on.png'             : 'img1_on.png';          $(this).attr('src', src);     } }); 

it worked when instead of $('rotate_images').on had $('img').on. what's happening - 'when click on image on page, if current image isn't img1_on.png, show img1_on.png...but want code apply specific div of images, not image.

any appreciated.

chris.

change selector to:

$('#rotate_images').. 

you forgot #


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -