ctrl+鼠标左键监听
生活随笔
收集整理的這篇文章主要介紹了
ctrl+鼠标左键监听
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title>div多選</title><style>.container{width: 100px;height: 100px;background-color: #E6E6E6;border:1px solid #cccccc;text-align: center;line-height: 100px;float: left;margin-left: 20px;}.redBorder{border: 1px solid red;}</style><script src="js/jquery-3.4.1.js" type="text/javascript"></script></head><body><div class="box"><div class="container">DIV</div><div class="container">DIV</div><div class="container">DIV</div></div></body><script>$(".container").mousedown(function(event) { if (event.button == 0) { // 鼠標左鍵if (event.ctrlKey) { // ctrlif ($(this).hasClass("redBorder")) {$(this).removeClass("redBorder");} else {$(this).addClass("redBorder");}}}})</script>
</html>
轉載于:https://www.cnblogs.com/sweeeper/p/11384272.html
總結
以上是生活随笔為你收集整理的ctrl+鼠标左键监听的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python爬虫实例--爬取拉勾网
- 下一篇: 最近使用SIFT匹配,尝试了一下从大图片