Tag Archives: learning jquery online

jQuery addBack() Method


jQuery addBack() Method Adds the previous set of elements to the current set.


Syntax of jQuery Traversing – addBack() Method

$(selector).addBack([selector element]);

jQuery addBack() Method – Example


Try it »

jQuery add() Method


jQuery add Method : Adds elements to the matched elements.


Syntax of jQuery Traversing – add() Method

$(selector).add(element,context);

Parameters :
element : One or more elements to be added in the matching selections.
context : Is optional. It is point of document from where selector should begin the matching.

jQuery add Method Example with syntax


Try it »

jQuery CallBack


jQuery Callback function is called when current action is completed. Example – When slideDown effect(action) is completed.


jQuery CallBack functions example

In the below example callback function is executed when the show effect is completed.

jQuery CallBack functions example


    

Try it »

jQuery Chaining


In jQuery you can link more then one jquery actions together.


jQuery Chaining Example And Code

jQuery Chaining Example


    

Try it »

Some Important Points about jQuery chaining :

  • It Improves Performance
  • Method called in sqquence of right to left ie. method added first will be called first and method added in last will be called in last.
    In the above example first .animate(),.css() and then slideUp() is called

jQuery Chaining Most Used Examples

[table width=”100%” colwidth=”20|190|50″ colalign=”left|left|center|left|right”]
No, Slide Animate Effect ,Syntax, Example & Demo
1, jQuery selector chaining example,$(“selector1\,selector2\,selector3\, selector4….”).method();, Example And Demo
2, jQuery chaining animations,—–, Example And Demo
[/table]

jQuery animate background color


jQuery animate({background:’yellow’}) will add background color animation effect.


jQuery animate background color Example And Code

jQuery animate background color Example


    

Try it »

jQuery SlideToggle Milliseconds


jQuery slideToggle milliseconds – If you want to add the slide toggle effect milliseconds means you want to add the slide finish with the milliseconds provided. Below is syntax and example with online demo and editor.


Syntax of jQuery SlideToggle Milliseconds

Here is syntax for slide toggle milliseconds effect

$(selector).slideToggle(speed,callback);

Speed : Speed in milliseconds. Add millisecond you want.

Callback : Callback function is optional. You can add function to be called when it completes the sliding effect.

Example And Demo with full code is given below.

jQuery SlideToggle milliseconds Example


    

Try it »

The above code will produce following result-
Note : Its screenshot of the output. To run this demo click on the above Try it button.
jQuery SlideToggle Milliseconds

jQuery SlideToggle Slow


jQuery SlideToggle slow Creates slow slide toogle effects in the elements.


Syntax : jQuery SlideToggle Slow

$(selector).slideToggle(speed,callback);

jQuery SlideToggle Slow Example


    

Try it »

jQuery Slide Up Slow


jQuery Slide Up slow Creates slow sliding effects in the elements.


Syntax of jQuery Slide Up Slow

$(selector).slideUp(speed,callback);

jQuery Slide Up Slow Example


    

Try it »

jQuery slide Up Fast


jQuery Slide Up fast : jQuery slideUp fast creates Fast sliding effects in the elements. $(selector).slideUp(“fast”); is used to add fast sliding effect in the html element


Syntax of jQuery Slide Up fast

$(selector).slideUp(speed,callback);

Speed : fast.

Callback : Callback function is optional. You can add function to be called when it completes the sliding effect.

jQuery slideUp Fast Example


    

Try it »

The above code will produce following result-

Note : This is screenshot of the output. To run this demo click on the above Try it button.
jQuery slide Up Fast Syntax And Example