Android Tutorial , Programming Tutorial, Php Tutorial, Learn Android, HTML Tutorial, Coding , Java Tutorial, GTU Programs, Learning Programming

Saturday, 14 January 2017

Slowly display div using JQuery

In this tutorial , we are learning that how to slowly display div using jQuery.

In JQuery , There are fadeIn() method is used to display div with slow effect.

Syntax : 


1
2
3
$(selector).fadein();  
$(selector).fadeIn(speed,callback);   
$(selector).fadeIn(speed, easing, callback);

  • speed : It is used to speed  of the delay in slow , fast and miliseconds.
  • easing : It is used for transition.
  • callback : It is called after fadeIn() effect.
Let's see the example :


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>  
<html>  
<head>  
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>  
<script>  
$(document).ready(function(){  
    $("button").click(function(){  
        $("#div1").fadeIn(1000);  
        $("#div2").fadeIn(5000);  
        $("#div3").fadeIn(8000);  
    });  
});  
</script>  
</head>  
<body>  
<h1>Desire Code : FadeIn() JQuery Effect</h1>  
<button>Click Here</button><br><br>  
<div id="div1" style="width:100px;height:80px;display:none;background-color:red;"></div><br/>
<div id="div2" style="width:100px;height:80px;display:none;background-color:green;"></div><br/>
<div id="div3" style="width:100px;height:80px;display:none;background-color:blue;"></div> 
</body>  
</html>


Output :

fadeIn

0 comments:

Post a Comment

Like us on Facebook

Site Visitor

Powered by Blogger.