InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

jQuery tutorials

    jQuery Ajax

    • jQuery JSONP
    • jQuery .post()
    • jQuery .load()
    • load script with cache enabled
    • jQuery .ajax() file upload

    jQuery CSS

    • change table cells color based on value
    • check if element is visible in viewport
    • display auto fade out message
    • fitvids.js for automatically resizing videos
    • get class list of an element
    • jQuery toggleClass() examples
    • make a div stick at top on scroll
    • table with alternate color rows

    jQuery Events

    • Javascript/jQuery - disable right click
    • jQuery - text input field - change keyup and paste events
    • trigger click using jQuery or Javascript

    jQuery DOM

    • jQuery html() vs text()
    • Check if an element exists
    • find total DOM elements
    • jQuery encode string to html entities
    • jQuery - read and modify iframe content
    • jQuery - create iframe with content
    • jQuery - find select element selectedIndex, value and text
    • jQuery - get checkbox value and checked state
    • jQuery - get javascript object

    jQuery Cookbook

    • get jQuery version
    • jQuery - add text to existing div
    • jQuery sliding effect - slideUp, slideDown, slideToggle

    jQuery UI

    • jQuery UI make element movable
    • jQuery ui slider and input text box - one way binding
    • jQuery ui slider and input text box - two way binding
     
    • Home
    • > Tutorials
    • > Javascript
    • > jQuery

    jQuery sliding effect – slideUp, slideDown, slideToggle

    on Oct 16, 2016

    jQuery slideDown, slideUp, slideToggle can be used to display, hide or toggle and element in sliding motion.

    .slideDown( [duration ] [, complete_callback ] )
    .slideDown( [duration ] [, easing ] [, complete_callback ] )
    .slideDown( options )
    .slideUp( [duration ] [, complete_callback ] )
    .slideUp( [duration ] [, easing ] [, complete_callback ] )
    .slideUp( options )
    .slideToggle( [duration ] [, complete_callback ] )
    .slideToggle( [duration ] [, easing ] [, complete_callback ] )
    .slideToggle( options )
    

    Example – slideDown

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
    <div style="display:none;background-color:lightblue;margin:10px;" id="slide1">Hello</div>
    <button onclick="clickHander()">Click to slide down hidden element</button>
    
    <script type="text/javascript">
    function clickHander() {
      $("#slide1").slideDown();
    }
    </script>
    refresh done
    try it online

    Example – slideDown with more options

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
    <div style="display:none;background-color:lightblue;margin:10px;" id="slide1">Hello</div>
    <button onclick="clickHander()">Click to slide down hidden element</button>
    <div id="log"></div>
    
    <script type="text/javascript">
    function clickHander() {
      $("#slide1").slideDown(1000, "swing", function() { $("#log").append("Done")});
    }
    </script>
    refresh done
    try it online

    Example – slideUp

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
    <div style="background-color:lightblue;margin:10px;" id="slide1">Hello</div>
    <button onclick="clickHander()">Click to slide up element</button>
    
    <script type="text/javascript">
    function clickHander() {
      $("#slide1").slideUp();
    }
    </script>
    refresh done
    try it online

    Example – slideToggle

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
    <div style="background-color:lightblue;margin:10px;" id="slide1">Hello</div>
    <button onclick="clickHander()">Click to slide toggle element</button>
    
    <script type="text/javascript">
    function clickHander() {
      $("#slide1").slideToggle();
    }
    </script>
    refresh done
    try it online

    Suggested posts:

    1. CSS general sibling selector
    2. CSS – align text in center horizontally
    3. ReactJS – convert jsx to javascript using babel cli
    4. CSS selector specificity
    5. Requirejs – quickstart guide for beginners
    6. jQuery – find select element selectedIndex, value and text
    7. jQuery ui slider and input text box – one way binding
    8. Make an element draggable using Vanilla Javascript
    Share this article: share on facebook share on linkedin tweet this submit to reddit
    Posted in Tutorials | Tagged Javascript, jQuery, Tutorials
    • Browse content
    • Article Topics
    • Article archives
    • Contact Us
    Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

    Copyright © 2025 InfoHeap.

    Powered by WordPress