Comparison of toggle with Slidetoggle and Fadetoggle in jquery

Source: Internet
Author: User

There are several ways to display and hide an action element.
For example:

    • Change style display to none
    • Set position height to 0
    • Set the transparency to 0

Can achieve this, and it provides a way to deal with jquery. Show/hide, Sildedown/sildeup, Fadein/fadeout. In addition, toggle, Sildetoggle, and Fadetoggle switching methods are introduced.

The difference between toggle, Sildetoggle, and Fadetoggle:
    • Toggle: Toggle Display and hide effects
    • Sildetoggle: Toggle roll up and down roll effect
    • Fadetoggle: Toggle Fade Effect
There are, of course, more differences in the details:

Toggle and slidetoggle Detail differences:
    • Toggle: The dynamic effect is from right to left. Horizontal motion, toggle the visibility of all matching elements through display
    • Slidetoggle: Dynamic effect from bottom to top. Vertical action, Slidetoggle toggles the visibility of all matching elements through a height change

Fadetoggle method

      • The Fadetoggle () method toggles between the FadeIn () and the FadeOut () methods.

      • The elements are faded out, and fadetoggle () displays them using the fade-in effect.

      • The elements are in-fade, and fadetoggle () displays them using the fade effect.

      • Note: Hidden elements are not fully displayed (no longer affect the layout of the page)

Comparison of toggle with Slidetoggle and Fadetoggle in jquery

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.