Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to disappear a div with explode effect using Jquery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 895
    Comment on it

    Hello Reader if you want to hide or disappear a div then you can do it by exlpode effect. This will driven by Jquery. First create a blank html file name is exlodeeffect.html and its code will go like this:-

    <html lang="en">  
       <head>  
    
          <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">  
          <script src="http://code.jquery.com/jquery-1.10.2.js"></script>  
          <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>  
           </head>  
       <body>  
          <div class="toggler">  
          <div id="effect" class="ui-widget-content ui-corner-all">  
             <h3 class="ui-widget-header ui-corner-all">Toggle</h3>  
             <p>  
             This is dummy data for your explode effect in div  This is dummy data for your explode effect in div  This is dummy data for your explode effect in div  This is dummy data for your explode effect in div 
             </p>  
          </div>  
          </div>  
          <a href="#" id="button" class="ui-state-default ui-corner-all">Hide dive by explode</a>  
       </body>  
    </html>
    

    Now it's jquery script will go like this:-

    <script>  
         $(function() {  
            function explodeEffect() {  
               $( "#effect" ).toggle('explode', 300);  
            };  
            $( "#button" ).click(function() {  
               explodeEffect();  
               return false;  
            });  
         });  
      </script> 
    

    It's CSS will go like this:-

      <style>  
             .toggler { width: 500px; height: 200px; }  
             #button { padding: .5em 1em; text-decoration: none; }  
             #effect { width: 240px; height: 155px; padding: 0.4em; position: relative; }  
             #effect h3 { margin: 0; padding: 0.4em; text-align: center; }  
          </style>  
    

    Now you when you load this page there is a toggle button name "Hide dive by explode". When user click this button the div above it will disappear with explode effect. This is very nice example to learn this Jquery exlode UI effect.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: