当前位置:网站首页>Moving the mouse into select options will trigger the mouseleave event processing scheme
Moving the mouse into select options will trigger the mouseleave event processing scheme
2022-07-24 14:10:00 【Traces of running】
Recently, I came across a project with a side tool menu , In the mouse mouseenter Event opens the corresponding detailed operation list , When mouseleave Close when , However, there is one in the operation list select , Whenever the mouse moves in select options The entire detailed list is hidden , Look at the screenshot below
Look at the mouse move in select options Before : Everything is all right 
Look at the mouse move in select options after : The original operation area disappeared 
The whole operation code fragment 
In order to deal with this problem , We thought of in menuleave In the middle of dom Element judgment , therefore F12 View the next page element 
So finally, the code is revised as follows , The problem has been preliminarily solved ( Although not perfect, it can be used reluctantly )
menuleave(e, i) {
setTimeout(() => {
var currTargetEl = e.relatedTarget || e.toElement
if (currTargetEl) {
const elTagName = currTargetEl.tagName
const targetClassName = currTargetEl.className
// ul Also include className==el-select-dropdown__list
if (elTagName === 'UL' && targetClassName.indexOf('el-select-dropdown__list') !== -1) {
return false
} else if (elTagName === 'LI' && targetClassName.indexOf('el-select-dropdown__item') !== -1) {
return false
} else if (!e.target.children[1]) {
return false
} else {
e.target.children[1].style.display = 'none'
}
}
}, 0)
},
Reference resources :
html select Control moved to option The tag is triggered mouseleave() resolvent
js Get all labels under a container , And determine the label type
边栏推荐
- 【NLP】下一站,Embodied AI
- C unsafe unmanaged object pointer conversion
- Flink comprehensive case (IX)
- sql server语法—创建数据库
- 【C语言笔记分享】——动态内存管理malloc、free、calloc、realloc、柔性数组
- C multithreaded lock collation record
- 如何在Ubuntu 18.04和Debian 9上安装PHP 5.6
- MySQL community download address
- [oauth2] II. Authorization method of oauth2
- Unity pedestrians walk randomly without collision
猜你喜欢

Network security -- Service Vulnerability scanning and utilization

Centos7安装达梦单机数据库

Multithreaded common classes

After reading this article, I found that my test cases were written in garbage

Apache2 ha experiment with raspberry pie

2022.7.22 模拟赛

2022年IAA行业品类发展洞察系列报告·第二期

达梦实时主备集群搭建

Nessus security testing tool tutorial

Sringboot-plugin-framework 实现可插拔插件服务
随机推荐
String - Sword finger offer 58 - ii Rotate string left
CSP2021 T3 回文
On the number of solutions of indefinite equations
Detailed explanation of switch link aggregation [Huawei ENSP]
自动化运维之Ansible安装部署
数据湖系列文章
[oauth2] IV. oauth2authorizationrequestredirectfilter
Mmdrawercontroller first loading sidebar height problem
Concurrent programming ----------- set
Soft link, hard link
看完这篇文章,才发现我的测试用例写的就是垃圾
Data modification modification
茅台冰淇淋“逆势”走红,跨界之意却并不在“卖雪糕”
Unity 委托 (Delegate) 的简单理解以及实现
OWASP ZAP安全测试工具使用教程(高级)
Introduction to the separation of front and rear platforms of predecessors
Stack and queue -- 232. Implement queue with stack
C multithreaded lock collation record
Flink advanced features and new features (VIII)
The KAP function of epidisplay package in R language calculates the value of kappa statistics (total consistency, expected consistency), analyzes the consistency of the results of multiple scoring obj