making Jquery Swap Image plugin target a new hyperlink -
i'm using swap image plugin, particularly disjoint rollovers 2.
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:
(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
Post a Comment