jquery - How to change an image when clicked using JavaScript? -


I have created a sliding image viewer as you can see, 4 small clicks to change / slide the image There are worthwhile images. When this is clicked, or when the appropriate main image is showing, I want to change this image. In this way, users can tell which main picture is being shown, can anyone see the source and how can it explain? Thanks!

Try the following code !!

  var src = []; Src ['normal'] = "http://beta.d-load.org/images/etc/imagev-norm.png"; Src ['active'] = "http://beta.d-load.org/images/etc/imagev-over.png"; $ (Document) .ready (function () {$ ('a', $ ('paging')) Click (function () {$ ('a', $ ('. Paging')). ('Atr ('Src', src ['normal']); $ (this) .find ('img') .tr ('src', src ['active']);});});  < / Pre> 

Here you can go, Demo :


Comments