making Jquery Swap Image plugin target a new hyperlink -


i'm using swap image plugin, particularly disjoint rollovers 2.

here's live page

i'm trying make target image (the big image on left) new hyperlink depending on image loaded there. code i'm using is

<img class="swapimagedisjoint { sin: ['#main:images/big-head-4.jpg'], sout: ['#main:main:images/blank-slate.jpg'] }" src="images/head-1.jpg" alt="" /> 

thanks

you don't need swap image want. can of single click method. put stripped-down example here:

http://jsfiddle.net/3enwq/

(in example, used img urls link url, don't have same)

i added attributes small images called swapimg , swapurl. used click function load these main image , mainlink href added. tacked on each() preload of large images if desire.

$('.swapimage').click( function() {     $('#main').attr('src', $(this).attr('swapimg'));    $('#mainlink').attr('href', $(this).attr('swapurl'));  }).each( function() {     var preloadimg = new image();    preloadimg.url = $(this).attr('swapimg');  }); 

if don't want attributes, can metadata swap image plugin does. can post example of if want it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -