答案:利用事件冒泡的原理,让自己的所触发的事件,让他的父元素代替执行! 解析: 1、那什么样的事件可以用事件委托,什么样的事件不可以用呢? 适合用事件委托的事件:click,mousedown,mouseup,keydown,keyup,keypress。 值得注意的是,mouseover 和 mo ...
分类:
Web程序 时间:
2021-06-02 11:20:11
阅读次数:
0
昨天群里有个盗贼发了个宏 乍一看这个条件判断语句写的好像没有问题,语句的判断条件是: 1.当存在焦点,且按键模式为alt时,选取该焦点单位为目标释放致盲。 2.对鼠标指向的单位释放致盲。 3.否则释放致盲,目标应为默认的当前目标。 但当我上线去试的时候发现,玛德居然真的对当前按不出致盲,而前两种情况 ...
分类:
其他好文 时间:
2021-04-27 15:07:24
阅读次数:
0
strip_tags strip_tags ( string $str , string $allowable_tags = ? ) : string 该函数尝试返回给定的字符串 str 去除空字符、HTML 和 PHP 标记后的结果。它使用与函数 fgetss() 一样的机制去除标记。 str 输 ...
分类:
Web程序 时间:
2021-01-18 10:41:39
阅读次数:
0
HTML代码: <div class="img"> <div class="whole"> <div class="roll-img"> <span class="last"><</span> <ul id="ul"> <li class="left"><img src="./img/1.png" ...
分类:
其他好文 时间:
2020-12-01 11:50:50
阅读次数:
1
效果图: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Docu ...
分类:
Web程序 时间:
2020-11-04 17:32:42
阅读次数:
31
今天在写js相册代码时注意到 mouseover是对整个组件起效果的,子元素会发生冒泡,比如这样无论我是移入时到li标签还是子元素img都 外边框都会是红色 而mouseenter只对监听的那个标签起效果,子元素没有发生冒泡,像这样我移动到img时边框就没了 mouseout 事件与mouseove ...
分类:
其他好文 时间:
2020-09-17 22:17:34
阅读次数:
30
JS的移入和移除函数的区别 移入事件: mouseover 和 mouseenter 移除事件: mouseout 和 mouseleave mouseover 和 mouseenter的区别 mouseover: 移入时,移入当前元素以及子元素都会触发事件的发生 mouseenter: 移入时只会 ...
分类:
Web程序 时间:
2020-08-19 19:33:45
阅读次数:
78
html:<a v-on:mouseover="changeActive($event)" v-on:mouseout="removeActive($event)" @click="backTOP" style="width: 39px;height: 39px;position: fixed;bo ...
分类:
其他好文 时间:
2020-07-27 13:49:30
阅读次数:
79
class Event { constructor(){ this.handlers = {}; // 记录所有的事件及处理函数 // { // click: [fn1, fn2], // mouseover: [fn3, fn4], // }; } /** * on 添加事件监听 * @param ...
分类:
其他好文 时间:
2020-07-26 19:05:55
阅读次数:
61
一、背景 在Web安全中,xss攻击绝对算是一种非常常见的攻击方式了,它能够窃取用户的隐私信息,比如cookie,也能够做一些非用户意图的操作来达到攻击目的。 二、原理 xss攻击是一种非法脚本的插入与执行攻击,全称为 cross site script ,即跨站脚本攻击。 通常我们访问一个安全的网 ...
分类:
其他好文 时间:
2020-07-26 15:56:23
阅读次数:
73