html - How to change a link with jQuery -


i'm making own image gallery , have decent version working.

fiddle

i'm trying change link main image when thumbnail image clicked not sure how or if can done. can assign link thumbnail can't use gallery need find way change link main image.

currently using following change image , hoping can changing link within same function

$('#thumb1').click(function() {    $('#imgdisplay').anystretch("images/url.jpg", {speed: 1000});    $fancy magik needs happen here i'm guessing;  }); 

tried adding

$("a[href='google link']").attr('href', 'other link'); 

to function broke it, still working on it

seems trying give link main image.

myfiddle

but clarify you, not need give link element redirect page. can js tricks using window.location.href like...

$('#imgdisplay').click(function() {    window.location.href = 'your path here'; }); 

and owwwwww... make code more readable , clean.. element same functionality, use class instead of id event listeners.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -