User:KazutoIKEDA/wiki/change-image.js
From 2009.igem.org
(Difference between revisions)
KazutoIKEDA (Talk | contribs) |
KazutoIKEDA (Talk | contribs) |
||
Line 1: | Line 1: | ||
- | $(document).ready( function() { $(".thumbnail | + | $(document).ready( function() { |
+ | $(".thumbnail a") | ||
+ | .fadeTo(1,0.5) | ||
+ | .hover( | ||
+ | function(){// マウスオーバー時 | ||
+ | $(this).fadeTo(200, 1.0); | ||
+ | }, | ||
+ | function(){// マウスアウト時 | ||
+ | $(this).fadeTo(500, 0.5); | ||
+ | } | ||
+ | ) | ||
+ | .click( function() { | ||
+ | var changeSrc = $(this).attr("href"); | ||
+ | $(".target img").attr("src", changeSrc); | ||
+ | return false; | ||
+ | }); | ||
+ | |||
+ | }); |
Revision as of 11:59, 21 October 2009
$(document).ready( function() { $(".thumbnail a") .fadeTo(1,0.5) .hover( function(){// マウスオーバー時 $(this).fadeTo(200, 1.0); }, function(){// マウスアウト時 $(this).fadeTo(500, 0.5); } ) .click( function() { var changeSrc = $(this).attr("href"); $(".target img").attr("src", changeSrc); return false; }); });