<< Back to article

jQuery with ASP.NET examples : Effects Sample


Hello Guest!!

Toggle Display
Hide
Show

Code:
            $('#divSample').toggle (1000); // will toggle display of the div "divSample"
                                          // it will animate for 1000 milisecond time
            
            $('#divSample').hide(1000); // will hide the div "divSample"
            
            $('#divSample').show(1000); // will show the div "divSample"
            
Hello Guest!!
Slide Up
Slide Down
Code:
            $('#divSample2').slideUp(1000); // will slide up the div "divSample"
            
            $('#divSample2').slideDown(1000); // will slide down the div "divSample"
            
            
Hello Guest!!
Fade out
Fade in
Animate
Code:
            $('#divSample3').fadeOut(1000); // will fade out the div "divSample"
            
            $('#divSample3').fadeIn(1000); // will fade in the div "divSample"
            
            $("#divSample3").animate( // will animate the div "divSample" 
                                      // to height 200px, width 400px and opacity of .5, for 1000 milisecond
                            {height:200
                                , width:400
                                , opacity: .5}
                                , 1000
                                , function()
                                {
                                    alert("Animation complete!"); // call method on completion of animation
                                });
            
            


For more information:


<< Back to article