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() { | $(document).ready( function() { | ||
- | $(".thumbnail a" | + | $("#mandala .thumbnail a") |
- | + | ||
.hover( | .hover( | ||
function(){// マウスオーバー時 | function(){// マウスオーバー時 | ||
- | $(this).fadeTo(200, | + | $(this).fadeTo(200, 0.7); |
}, | }, | ||
function(){// マウスアウト時 | function(){// マウスアウト時 | ||
- | $(this).fadeTo(500, | + | $(this).fadeTo(500, 1.0); |
} | } | ||
) | ) | ||
.click( function() { | .click( function() { | ||
var changeSrc = $(this).attr("href"); | var changeSrc = $(this).attr("href"); | ||
- | $(".target img").attr("src", changeSrc); | + | $("#mandala .target img").attr("src", changeSrc); |
return false; | return false; | ||
}); | }); | ||
}); | }); |
Revision as of 12:02, 21 October 2009
$(document).ready( function() { $("#mandala .thumbnail a") .hover( function(){// マウスオーバー時 $(this).fadeTo(200, 0.7); }, function(){// マウスアウト時 $(this).fadeTo(500, 1.0); } ) .click( function() { var changeSrc = $(this).attr("href"); $("#mandala .target img").attr("src", changeSrc); return false; }); });