User:KazutoIKEDA/wiki/change-image.js
From 2009.igem.org
(Difference between revisions)
KazutoIKEDA (Talk | contribs) |
KazutoIKEDA (Talk | contribs) |
||
Line 4: | Line 4: | ||
function(){ | function(){ | ||
$(this).fadeTo(200, 0.8); | $(this).fadeTo(200, 0.8); | ||
- | },function(){ | + | }, |
+ | function(){ | ||
$(this).fadeTo(600, 1.0); | $(this).fadeTo(600, 1.0); | ||
} | } | ||
Line 10: | Line 11: | ||
.click( | .click( | ||
function() { | function() { | ||
- | $("#biomario .target img").attr("src", | + | var changeSrc = $(this).attr("href"); |
+ | $("#biomario .target img").attr("src", changeSrc); | ||
return false; | return false; | ||
} | } | ||
); | ); | ||
+ | |||
$("#cocktail .thumbnail a") | $("#cocktail .thumbnail a") | ||
.hover( | .hover( |
Revision as of 11:41, 21 October 2009
$(document).ready( function() { $("#biomario .thumbnail img") .hover( function(){ $(this).fadeTo(200, 0.8); }, function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { var changeSrc = $(this).attr("href"); $("#biomario .target img").attr("src", changeSrc); return false; } ); $("#cocktail .thumbnail a") .hover( function(){ $(this).fadeTo(200, 0.8); },function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { $("#cocktail .target img").attr("src", $(this).attr("href")); return false; } ); $("#mandala .thumbnail a") .hover( function(){ $(this).fadeTo(200, 0.8); },function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { $("#mandala .target img").attr("src", $(this).attr("href")); return false; } ); $("#pyramid .thumbnail a") .hover( function(){ $(this).fadeTo(200, 0.8); },function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { $("#pyramid .target img").attr("src", $(this).attr("href")); return false; } ); $("#tomb .thumbnail a") .hover( function(){ $(this).fadeTo(200, 0.8); },function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { $("#tomb .target img").attr("src", $(this).attr("href")); return false; } ); $("#bunny .thumbnail a") .hover( function(){ $(this).fadeTo(200, 0.8); },function(){ $(this).fadeTo(600, 1.0); } ) .click( function() { $("#bunny .target img").attr("src", $(this).attr("href")); return false; } ); }):