本文共 1498 字,大约阅读时间需要 4 分钟。
jquery双击修改
jQuery dblclick() function fires when an HTML element is double clicked. This method will attach an event handler to the double click event. We can do desired manipulations on the selected HTML element using the jQuery double click event handler.
双击HTML元素时,将触发jQuery dblclick()函数。 此方法会将事件处理程序附加到双击事件。 我们可以使用jQuery双击事件处理程序对选定HTML元素进行所需的操作。
jQuery double click event syntax:
jQuery双击事件语法:
In this, dblclick() method is used without an argument.
在这种情况下,使用dblclick()方法时不带参数。
The handler could be any function that is executed each time the double click event is fired.
该处理程序可以是每次触发双击事件时执行的任何函数。
Following example demonstrates the use of jQuery dblclick() event method.
以下示例演示了jQuery dblclick()事件方法的使用。
jQuery Double Click JournalDev
In this example, you can see that dblclick()
method is triggered when you double click on the <div> element.
在此示例中,您可以看到双击<div>元素时触发了dblclick()
方法。
In this method, we pass a handler to change the background color of the <div> element.
在此方法中,我们传递了一个处理程序来更改<div>元素的背景颜色。
The toggleClass() method toggle between the two CSS class defined in the above code. The toggleClass()
method executes each time when we double click on the element.
toggleClass()方法在上述代码中定义的两个CSS类之间切换。 每次双击元素时,都会执行toggleClass()
方法。
You can see above jQuery example in action by visiting below URL.
您可以通过访问下面的URL来查看上面的jQuery示例的运行情况。
翻译自:
jquery双击修改
转载地址:http://hdlzd.baihongyu.com/