Created
March 6, 2020 18:47
-
-
Save kaoru-fukusato/e7b9589cb0c51b475a5b96b47e3259ec to your computer and use it in GitHub Desktop.
クリッカブルマップをスマホでも使えるようにしたい
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
<script type="text/javascript" src="jquery-1.11.0.min.js"></script> | |
<script type="text/javascript" src="jquery.rwdImageMaps.js"></script> | |
<script> | |
$(function(){ | |
$('img[usemap]').rwdImageMaps(); | |
}); | |
</script> | |
//※function()が2個になるなど複数記入したい場合は以下で | |
<script type="text/javascript"> | |
window.onload = function () { // ページ読み込み時 | |
funcAdd1(); // 他のコード | |
funcAdd2(); // イメージマップ | |
} | |
function funcAdd1() { | |
他のコード | |
function funcAdd2(){ | |
$(document).ready(function(e) { | |
$('img[usemap]').rwdImageMaps(); | |
$('area').on('click', function() { | |
alert($(this).attr('alt') + ' clicked'); | |
}); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment