ボタンを触ったときに画像を変更させるロールオーバーは良く使いますよね。 jqueryを使っての簡単ロールオーバーする方法を紹介します。 $(function(){ $("img[src=’img/button.gif’]").mouseover(function(){ $(this).attr("src","img/button_on.gif"); }).mouseout(function(){ $(this).attr("src","img/button.gif"); }); }); 解説 $("img[src='img/button.gif']").mouseover 画像を$(“img[src=’img/button.gif’]”)で選択して、 mouseoverでマウスが画像の上にのったときに下記のイベントが実行されます。 (function(){ $(this).attr("sr
![jqueryでロールオーバー(マウスで触ったときに画像が変わる)する方法](https://cdn-ak-scissors.b.st-hatena.com/image/square/3ba5f847cf642a686ea0bfea3e9d1d62789311ca/height=288;version=1;width=512/http%3A%2F%2Fwww.geekzshu.com%2Fwp-content%2Fthemes%2Fsango-theme%2Flibrary%2Fimages%2Fdefault.jpg)