JQuery plug-in realizes mouse hiding


This example shares the specific code of jQuery plug-in to realize mouse hiding for your reference. The specific contents are as follows

When the mouse hovers over a DOM, it will automatically hide it for you. The effect picture can’t work because of the problem of the screen recording software

The effect is as follows

Code part

<!DOCTYPE html>
  <meta charset="utf-8">
  < title > hide for a long time < / Title >
  <script src="js/jquery-3.4.1.min.js"></script>
    margin: 0;
    padding: 0;
    border: 1px solid lightgray;
    width: 100px;
    height: 100px;
    margin: 10px;
    float: left;
  <div style="background-color: #1abc9c;"></div>
  <div style="background-color: #3498db;"></div>
  <div style="background-color: #f1c40f;"></div>
  <div style="background-color: #e74c3c;"></div>
  <div style="background-color: #9b59b6;"></div>
   op=op==undefined? []:op;// object
   time = time==undefined? 500:time;// How long to hide
   var str = op.join(',');
   var t = null;
   var f = false;
    f = true;
    f = false;
   function hid(){
    t =setTimeout(function(){
     Console.log ('hidden ');

Train of thought explanation

  • Taking all actions into account, as long as the mouse conforms to our judgment, give a style cursor: none
  • In addition, restore the default style to cursor: default

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support developpaer.

Recommended Today

OC basis

IOS development interview essential skills chart.png What are objects and what are the objects in OC? An object is an instance of a class; Is an instance created through a class, which is generally called an instance object; Common objects in OC include instance objects, class objects, and metaclass objects; What is a class? What […]