In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "what is the function of jquery to show and hide elements". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what is the function of jquery to show and hide elements"!
The functions used by jquery to show and hide elements are: 1, show (), using this method to show hidden elements, the syntax is "element object .show (display speed, function)"; 2, hide (), using this method to hide the displayed element, the syntax is "element object .hide (hidden speed, function)".
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
What functions are used by jquery to show and hide elements
1. Display element: show ()
If the selected elements are hidden, they are displayed:
Grammar
$(selector) .show (speed,callback)
Speed is optional. Specifies the speed of the element from hidden to fully visible. The default is "0".
Possible values:
Milliseconds (e.g. 1500)
"slow"
"normal"
"fast"
In the case of setting the speed, the element gradually changes its height, width, outer margin, inner margin, and transparency as it goes from hidden to fully visible.
Callback is optional. The function to be executed after the show function has been executed. You cannot set the speed parameter unless it is set.
2. Hidden element: hide ()
If the selected element is already displayed, it is hidden.
Grammar
$(selector) .hide (speed,callback)
Speed is optional. Specifies the speed at which the element is hidden from the visible. The default is "0".
Possible values:
Milliseconds (e.g. 1500)
"slow"
"normal"
"fast"
In the case of setting the speed, the element gradually changes its height, width, outer margin, inner margin, and transparency as it is visible and hidden.
Callback is optional. The function to be executed after the hide function has been executed.
You cannot set the speed parameter unless it is set.
Examples are as follows:
$(document) .ready (function () {$(".btn1") .click (function () {$("p"). Hide ();}); $(".btn2") .click (function () {$("p"). Show ();})
This is a paragraph.
HideShow
Output result:
At this point, I believe you have a deeper understanding of "what is the function of jquery to show and hide elements". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.