Skip to main content

Implement following tasks using jQuery:  Sliding page elements  Hiding and Showing elements  Fading elements  Toggling elements  Stopping effects

Tags used were:

i) Sliding elements : This is created using these three functions of jquery.
1) slideDown :This method is used to slide down an element.
Syntax: $(selector).slideDown(speed,callback);
2) slideUp : This method is used to slide up an element.
Syntax: $(selector).slideUp(speed,callback);
3) slideToggel : This method is used to toggle between slideDown and slideUp.
Syntax: $(selector).slideToggle(speed,callback);

ii) Hiding and Showing elements  : This is created using these two functions of jquery.
1) hide :This method is used to hide the element.
Syntax: $(selector).hide(speed,callback);
2) show :This method is used to display the hidden element.
Syntax: $(selector).show(speed,callback);
  
iii) Fading elements  : This is created using these four functions of jquery. 
1) fadeIn: This method is used to fade in a hidden element.
Syntax: $(selector).fadeIn(speed,callback);
2) fadeOut: This  method is used to fade out a visible element.
Syntax: $(selector).fadeOut(speed,callback);
3) fadeToggle: This  method toggles between the fadeOut and fadeIn methods.
Syntax: $(selector).fadeToggle(speed,callback);
4) fadeTo: This method allows fading to a given opacity (value between 0 and 1).
Syntax: $(selector).fadeTo(speed,opacity,callback);

Note: Above all the function has optional speed parameter specifies the duration of the effect. It can 
take the following values: "slow", "fast", or milliseconds.The optional callback parameter is a function
 to be executed after the fading completes.

iv) Stopping effects : This method is used to stop an animation or effect before it is finished.
Syntax:$(selector).stop(stopAll,goToEnd);
The optional stopAll parameter specifies whether also the animation queue should be cleared or not.
The optional goToEnd parameter specifies whether or not to complete the current animation
 immediately.
Video:

Comments