I have this here script:
// JavaScript Document
$(document).ready(function(){
$.fn.wait = function(time, type) {
time = time || 1000;
type = type || "fx";
return this.queue(type, function() {
var self = this;
setTimeout(function() {
$(self).dequeue();
}, time);
});
};
$('#home').click(function(){
$('.content').slideUp(500);
$('#homewrap').slideUp(500);
$('#contentwrap').stop().wait().animate(
{backgroundPosition:'(0px 0px)'},
{duration:500});
$('#facewrap').stop().wait().animate(
{backgroundPosition:'(0px 0px)'},
{duration:500})
$('#homewrap').wait().fadeIn(500);
});
-
- // JavaScript Document
- $(document).ready(function(){
-
- $.fn.wait = function(time, type) {
- time = time || 1000;
- type = type || "fx";
- return this.queue(type, function() {
- var self = this;
- setTimeout(function() {
- $(self).dequeue();
- }, time);
- });
- };
-
- $('#home').click(function(){
- $('.content').slideUp(500);
- $('#homewrap').slideUp(500);
- $('#contentwrap').stop().wait().animate(
- {backgroundPosition:'(0px 0px)'},
- {duration:500});
- $('#facewrap').stop().wait().animate(
- {backgroundPosition:'(0px 0px)'},
- {duration:500})
- $('#homewrap').wait().fadeIn(500);
- });
-
the .wait() effect is workin just fine 66% of the time. The last line of each function:
$('#homewrap').wait().fadeIn(500);
-
- $('#homewrap').wait().fadeIn(500);
-
isn't working, the fadeIn effect is initiating during the
$('#facewrap').stop().wait().animate(
{backgroundPosition:'(0px 0px)'},
{duration:500})"
animation.
Each item except for that line is waiting it's turn as it should.
Use your words like arrows to shoot toward your goal.