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 img") | $(".thumbnail img") | ||
- | |||
- | |||
- | |||
// マウスオーバー・マウスアウト時 | // マウスオーバー・マウスアウト時 | ||
.hover( | .hover( | ||
Line 17: | Line 14: | ||
.click( function() { | .click( function() { | ||
var changeSrc = $(this).attr("src"); | var changeSrc = $(this).attr("src"); | ||
- | $(" | + | $(".target img").attr("src", changeSrc); |
return false; | return false; | ||
}); | }); | ||
}); | }); |
Revision as of 03:46, 20 October 2009
$(document).ready( function() { $(".thumbnail img") // マウスオーバー・マウスアウト時 .hover( function(){// マウスオーバー時 $(this).fadeTo(200, 0.8); }, function(){// マウスアウト時 $(this).fadeTo(600, 1.0); } ) // クリック時の処理 .click( function() { var changeSrc = $(this).attr("src"); $(".target img").attr("src", changeSrc); return false; }); });