Created
October 21, 2016 11:01
-
-
Save naokisekiguchi/e5b394cf9861a933799bdb5404482fa2 to your computer and use it in GitHub Desktop.
ドキュメント内のaタグにクリックイベントを追加
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
function addEventLink(){ | |
//ドキュメント内のaタグを全て取得 | |
Array.from(document.querySelectorAll("a"), (e) => { | |
//取得した要素(aタグ)にtouchstartイベントを設定(CHIRIMENではマウスイベントはtouchイベントに置き換えられる) | |
e.addEventListener("touchstart",()=>{ | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment