In Jquery, the show () and hide () methods are used to show and hide images,
(1) Function Description
Click "show" link on the page, use the show () method to display an image in an animated manner, and execute a callback function in the method to change the border style of the image; when you click an image that has been displayed, you can use hide () to hide the image in an animated manner.
(2) Implementation Code
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Animation Mode Display
Usage of jquery hide () and show () Methods
Syntax
$ (Selector). hide (speed, callback)
Speed has three effect parameters • Millisecond (for example, 1500)
• "Slow"
• "Normal"
• "Fast"
When you set the speed, the height, width, margin, padding, and transparency of an element gradually change from visible to hidden.
Example
This is super simple display and hiding. To achieve this, we only need to include time or parameters in hide or show.
<script type="text/javascript">$(document).ready(function(){ $(".btn1").click(function(){ $("p").hide(1000); }); $(".btn2").click(function(){ $("p").show(1000); });});</script>
Finally, we will summarize the display hiding Effect of show and hide.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The above content is a small part of Jquery that I will share with you. I hope you will like it.