Home > Web Front-end > JS Tutorial > The difference between mouseover and mouseenter in jQuery events

The difference between mouseover and mouseenter in jQuery events

黄舟
Release: 2017-06-28 14:03:16
Original
1381 people have browsed it

Mouseover and mouseoutevents are often used in our pages to add better rendering effects to the page, but if the element that triggers the mouseover event has child elements, It will cause a flickering effect, which is very uncomfortable to look at. This is because mouseover and mouseout will be triggered regardless of whether the mouse pointer passes through the selected element or its sub-elements. The mouseenter and mouseleave events will only be triggered when the mouse pointer passes through the selected element.

<ul class="con-ul">
    <li>
        <div class="con-one">
            <div class="con-oneimg">
                <img src="http://image123465.cn">
            <div class="dask" style="display: block; opacity: 0;"></div>
            <div class="input" style="display: block; opacity: 0;">
                <input type="button" class="inp inp-one" value="预览">
                <input type="button" class="inp inp-two" value="使用">
            </div>
            </div>
        <hr style="border-top:1px solid #b5b5b5;">
        <p>study</p>
        </div>
    </li>
</ul>
Copy after login
rrree

The above is the detailed content of The difference between mouseover and mouseenter in jQuery events. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template