What is the syntax to assign a speed to each fade?
function fadeIn()
{
$(this).fadeIn( fadeOut );
}
function fadeOut()
{
$(this).fadeOut( fadeIn );
}
fadeIn.call($("#myImage"));
What is the syntax to assign a speed to each fade?
function fadeIn()
{
$(this).fadeIn( fadeOut );
}
function fadeOut()
{
$(this).fadeOut( fadeIn );
}
fadeIn.call($("#myImage"));
The syntax is to pass in a number representing the number of miliseconds the effect will last, like this:
function fadeIn() {
$(this).fadeIn(1000); // 1 second
}
You can also create a variable to store the number
var length = 1000;
function fadeIn() {
$(this).fadeIn(length);
}
Did you consider reading the documentation here? 'Cause you approach seems really too lazy.
It's clearly stated that you have 'slow' (200ms) and 'fast' (600ms) parameters as well as being able to specify the duration in milliseconds..
.fadeIn( [ duration ], [ callback ] )