Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

jQuery UI Slide Effect

  • Last Updated : 25 Jan, 2021

In this article, we are going to show the effect of the slide using jQuery UI, all the content will come in from the left when the action button is clicked which actually triggers the slide effect script.

Syntax :

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

$( ".selector" ).effect( 
         selectedEffect, options, time(in ms), callback 


  • selectedEffect: Select any effect given in jQuery UI.
  • options: Added for certain functionality (optional)
  • time: Time to complete the effect in microseconds.
  • callback: Added for certain functionality (optional).

Return  value: It will not return you anything.

Scripts added : Please download the library or use the paths for the given scripts below.

<link rel=”stylesheet” href=”//”>

<script src=””></script>

<script src=””></script>

Example: In this example, we are going to show the slide effect using jQuery UI. We will trigger the script using a  button.


<!doctype html>
<html lang="en">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Geeks For Geeks</title>
        <link rel="stylesheet" 
        <script src="">
        <script src="">
            $( function() {
                function action(selectedEffect) {
                    $( "#effect" ).effect( selectedEffect, 1200);
                $( "#button" ).on( "click", function() {
                    return false;
            } );
                width: 500px; 
                height: 500px; 
                position: absolute;
               padding: .5em 1em; 
               text-decoration: none;
               position: absolute;
               width: 250px; 
               height: 190px; 
               padding: 15px; 
               position: relative;
        <h3>Geeks for Geeks Slide Effect Using jQuery UI</h3>
        <div class="animation">
            <div id="effect" class="ui-widget-content ui-corner-all">
                <h3 class="ui-widget-header ui-corner-all" 
                    style="margin: 0; padding: 0.4em; 
                     height: 170px; text-align: center;
                      background-color: green;">
                  Geeks For Geeks
        <span style="margin-left: 6em;">
          <button id="button" 
                  class="ui-state-default ui-corner-all" 
                  style="margin-top: 18em;">

Output :

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!