728x90
반응형
- 2023-10-24 : First posting.
Result
Wheel click 으로 새창이 안열리게 하려면 a tag 의 href 를 제거해주면 됨.
## Code
```[.linenums.lang-html]
<div class="center" id="click-me" style="font-size:3em; border:5px solid wheat; background:rgb(200,200,255); width:100%; padding:2em 1em"><a id="a-click-me" style="color:rgb(255,200,200)">Click me</a></div>
<div id="result">Result</div>
<script>
window.m=window.m||{};
m.onFunction=function (event) {
console.log(event);
event.preventDefault();
event.stopPropagation();
$("#result").html(`event: ${event}<br>event.type: ${event.type}<br>event.which: ${event.which}<br>event.button: ${event.button}<br>event.buttons: ${event.buttons}`);
};
$("#click-me").on("click dblclick mouseup mousedown wheel scroll", m.onFunction);
$("#a-click-me").on("click dblclick mouseup mousedown wheel scroll", function (e) {
e.preventDefault();
});
</script>
```/
## RRA
728x90
반응형
'[IT/Programming] > HTML related' 카테고리의 다른 글
Neighbors points plot plan (svg) (2) | 2023.10.25 |
---|---|
트위터 트윗 퍼오기 (Embedding Twitter Tweet) (0) | 2023.10.25 |
<link ref="canonical" href="..." /> 설정하기 (DISQUS config 활용) (0) | 2023.10.25 |
틱톡 (TikTok) | weverse.io 퍼오는 법 (3) | 2023.10.25 |
댓글 플러그인 | 위젯 (SNS comment plug-in | widget) (3) | 2023.10.24 |
Learning Vert.x (0) | 2023.05.30 |
HTML docuK format ver. 2.1, short copiable version (2023-05-30) (0) | 2023.05.30 |