Jquery's super simple div display and hide special effect demo, jquerydiv special effect demo

Source: Internet
Author: User

Jquery's super simple div display and hide special effect demo, jquerydiv special effect demo

I am bored. I wrote one myself when I saw the DIV display and hiding effects on a video website.

I think it is quite simple.

Frontend changes the world! Hey, you have a sense of accomplishment.

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <meta http-equiv =" Content-Type "content =" text/html; charset = UTF-8 "/> <title> untitled document </title> <script src =" jquery_last.js "type =" text/javascript "> </script> <script type =" text/javascript "> $ (document ). ready (function () {}); function hiden () {$ ("# divObj "). hide (); // The hide () function to hide data. A time parameter (millisecond) can also be included in the brackets. For example, hide (2000) can be hidden at a speed of 2000 milliseconds, it can also contain slow, fast} function slideToggle () {$ ("# divObj "). slideToggle (2000); // switch the curtain effect. Click close and open. The parameter can be left blank. The parameter description is the same as above} function show () {$ ("# divObj "). show (); // display, parameter description above} function toggle () {$ ("# divObj "). toggle (2000); // display hidden switchover. The parameter can be left blank. The parameter description is the same as above} function slide () {$ ("# divObj "). slideDown (); // curtain effect expansion} </script> 

Copy the file to the HTML file and run it.

I don't have a server, so I can't pass the DEMO ....


A simple jquery html example for hiding a div.

You asked me in the morning. It's a js version, as shown in the following figure. It's changed to jquery,
Jquery is relatively simple. Remember to reference jquery. js:
<Head> <title> find a simple jquery html example to show hidden div </title> <script src = "jquery-1.7.1.min.js"> </script> <script type = "text/ javascript "> function showDiv () {// display all div $ ("div "). show ();} function showDiv1 () {$ ("# div1 "). show ();} function hideDiv () {// hide all div $ ("div "). hide () ;}</script>
JQuery hiding and display problems. I only need to display a DIV, and all other divs must be hidden. Code, thanks

The four divs in the drop-down list are bound to the same class and different IDs. Click bind class when the event is clicked to disable all Divs, and then output the drop-down menu by binding a unique id, I just wrote the code on the local machine and implemented it using the above method. I personally feel that there are other more convenient methods for implementation.
Html:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "www.w3.org/..al.dtd">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.