javascript - Off and mask click!
过去多啦不再A梦
过去多啦不再A梦 2017-05-19 10:22:09
0
1
586

Add a click event to the mask on the left. After clicking, the area on the right will be retracted.
But the event is added to the mask, so if you click on the area on the right, it will be retracted.
What I want The effect is to only click on the black and transparent area on the left, and the event bubbles up. I have used capture, but it doesn’t work.
Please explain it to an expert

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
刘奇
遮罩.addEventListener('click', function(e) {
    if (e.target === 遮罩) {
        区域收起
    }
})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!