Created
May 9, 2014 07:23
-
-
Save ituki/a05476abdd12a27ee429 to your computer and use it in GitHub Desktop.
移動時に途切れないmapのfade ref: http://qiita.com/ituki_b/items/935dcbb4b0b2c736608c
This file contains 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
<!--html--> | |
<img src="http://jsrun.it/assets/o/l/f/d/olfdl.gif" alt="" usemap="#link"><!--画像--> | |
<map name="link"> | |
<area shape="rect" coords="0,0,137,100" href="http://google.co.jp" alt="Google"><!--area1--> | |
<area shape="rect" coords="138,0,275,100" href="http://yahoo.co.jp" alt="Yahoo"><!--area2--> | |
</map> |
This file contains 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
//js | |
$('map').hover(function(){ | |
$('img[usemap="#' + $(this).attr('name') + '"]').fadeTo(100,0.3); | |
},function(){ | |
$('img[usemap="#' + $(this).attr('name') + '"]').fadeTo(100,1); | |
}); |
This file contains 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
$('map').hover(function(){ | |
$('img[usemap="#' + $(this).attr('name') + '"]').stop().fadeTo(100,0.3); | |
},function(){ | |
$('img[usemap="#' + $(this).attr('name') + '"]').stop().fadeTo(100,1); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment