Created
July 26, 2011 14:27
-
-
Save rskull/1106886 to your computer and use it in GitHub Desktop.
カーソルが乗った時画像を切り替える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//画像切り替え | |
//ImgCng('画像ID','切り替えたい画像名'); | |
//例 : ImgCng('img','image/img2.jpg'); | |
function ImgCng(id,img){ | |
var cng1 = document.getElementById(id); | |
var cng2 = cng1.src; | |
cng1.onmouseover = function () { | |
cng1.src = img; | |
} | |
cng1.onmouseout = function () { | |
cng1.src = cng2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment