Simple Animations With The Help Of Jquery
You can slide elements or any content of HTML and even stop animations in mid-sequence. To slide elements up or down.
$("#Element").slideDown("fast", function() {
// For slide down
}
$("#Element").slideUp("slow", function() {
// For slide up
}
$("#Element").slideToggle(1000, function() {
// For slide up/down
}
The new styles, but instead of setting them instantly (as CSS or raw JavaScript would do), it does so gradually, animating
the effect at the chosen speed:
$("#Element").animate(
{
opacity: .3,
width: "500px",
height: "700px"
}, 2000, function() {
// optional callback after animation completes
}
);
Animation with jQuery is the very powerful, and it does have its quirks (for example, to animate colors, you need a special
plugin).
1 Comment(s)