User:KazutoIKEDA/wiki/change-image.js
From 2009.igem.org
< User:KazutoIKEDA
Revision as of 05:57, 20 October 2009 by KazutoIKEDA (Talk | contribs)
Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh); Konqueror: click Reload or press F5; Opera: clear the cache in Tools → Preferences; Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(document).ready( function() { $(".thumbnail a") // マウスオーバー・マウスアウト時 .hover( function(){// マウスオーバー時 $(this).fadeTo(200, 0.8); }, function(){// マウスアウト時 $(this).fadeTo(600, 1.0); } ) // クリック時の処理 .click( function() { var changeSrc = jQuery(this).attr("href"); $(".target img").attr("src", changeSrc); return false; }); });