Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


jQuery Fading Method

fading methods iquery

  • Please log in to reply
&nsbp;

#1 DesGuru

DesGuru

    Senior Member

  • Designer
  • 220 posts

Posted 02 November 2012 - 03:41 PM

Using jQuery fading method, you can fade elements in and out.
jQuery has a number of fade methods:

•fadeIn() method: used to fade in hidden elements

Syntax:

$(selector).fadeIn(speed,callback);
The speed parameter is optional and it specifies the effect’s duration. It can have values: slow, fast, or milliseconds. The callback parameter is also optional and it specifies the name of the function that you want to execute after the fading finishes.

Ex.
$("button").click(function(){
$("#div").fadeIn("slow");
});

•fadeOut()

This method is used to fade out visible elements.

Syntax:

$(selector).fadeOut(speed,callback);
The speed parameter is optional and it specifies the effect’s duration. It can have values: slow, fast, or milliseconds. The callback parameter is also optional and it specifies the name of the function that you want to execute after the fading finishes.

Ex.
Example
$("button").click(function(){
$("#div").fadeOut(slow);

});

•fadeTo()
This method allows fading to a specific opacity (between 0 and 1).

Syntax:

$(selector).fadeTo(speed,opacity,callback);
The speed parameter is required and it specifies the effects duration, it could be (slow, fast or milliseconds). The opacity parameter is required and it specifies the fading to a given opacity (between 0 and 1).The callback parameter is optional and it is the name of the function you want to execute after the function finishes.

Ex.
$("button").click(function(){
$("#div").fadeTo("fast",0.20);
});

•fadeToggle()
This method is used to toggle between the fadeIn() and fadeOut() methods. If elements are faded out, the fadeToggle() method will fade them in, and if they’re faded in, this method will fade them out.

Syntax:

$(selector).fadeToggle(speed,callback);
The speed parameter is optional and it specifies the effect’s duration. It can have values: slow, fast, or milliseconds. The callback parameter is also optional and it specifies the name of the function that you want to execute after the fading finishes.

Ex.
$("button").click(function(){
$("#div").fadeToggle();
$("#divx").fadeToggle(2000);
});

#2 HUH

HUH

    Member

  • Designer
  • 117 posts

Posted 29 November 2012 - 05:17 AM

great thanks my friend Des Guru realy great post

#3 lorensius

lorensius

    Junior Member

  • Designer
  • 11 posts

Posted 03 December 2012 - 05:44 AM

thanks for your post.helpfil for me

#4 HUH

HUH

    Member

  • Designer
  • 117 posts

Posted 03 December 2012 - 05:58 AM

thanks very nice

#5 Almeida

Almeida

    Member

  • Designer
  • 75 posts

Posted 17 December 2012 - 04:18 PM

Ótimo post!! Obrigado

#6 pandor

pandor

    Member

  • Designer
  • 59 posts

Posted 13 February 2013 - 11:11 AM

I tried it it works great...Many Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users