Get the App
SLTechnology News&Howtos  ›  Development  › 

How does jquery make the element disappear in a few seconds

Shulou Source: shulou.com Published: 2022-06-01 04:58:35 10月05日 Update

This article introduces the knowledge of "how jquery makes elements disappear in a few seconds". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Jquery makes the element disappear after a few seconds: 1, use the delay () function to set the delay time; 2, use the hide (), toggle () or slideDown () function to make the element disappear after the specified delay time, syntax "element object .delay (delay seconds). Delay ();"

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.

Jquery makes the element disappear in a few seconds

In jquery, you can use the delay () method and the hide () (toggle () or slideDown () method) to make the element disappear after a few seconds

The delay () function sets the delay time

The hide (), toggle (), or slideDown () function makes the element disappear after the specified delay time

Implementation code: disappear in three seconds

$(document) .ready (function () {$("button") .click (function () {$("p"). Delay (3000) .hide (2000);}) Hide element test text

This is the content of "how jquery makes elements disappear in a few seconds". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Elements delays functions time methods content more knowledge practicality learning and then code dilemmas reality objects situations tutorials texts articles cases Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information Linux Shulou Tech Info Xiaomi