Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How jquery makes the element disappear in 3 seconds

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how jquery makes elements disappear after 3 seconds". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how jquery makes elements disappear after 3 seconds".

Jquery makes the element disappear after 3 seconds: 1, use the delay () method to specify the delay time of the operation; 2, use the hide () method to hide the element after the specified delay time, and the syntax is "$(specified element) .delay (3000) .hide (300);".

The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.

How to make the element disappear after 3 seconds by jquery

To achieve the effect that the element disappears after three seconds, you need to use the delay () method and the hide () method.

The delay () method sets the delay for the execution of the next item in the queue.

The syntax is:

$(selector) .delay (speed,queueName)

The hide () method is used to hide elements.

Let's take a look at how to make the element disappear after 3 seconds by using the above two methods, as shown in the following example:

(function () {$("# dianji") .click (function () {$("# disappare"). Delay (3000) .hide (300);}) Click

It will disappear automatically after clicking for 3 seconds.

Output result:

Thank you for your reading, the above is the content of "jquery how to make elements disappear after 3 seconds". After the study of this article, I believe you have a deeper understanding of how jquery makes elements disappear after 3 seconds, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report