$('.anfahrt').click(function() {
$button = $(this);
if (clickedc == 0){
if(!$button.hasClass('disabled')) {
$button.addClass('disabled');
clickedc = 1
$('.lupe').animate({opacity: '0'},750)
$('.card > img').animate({height: 150, width: 193, opacity: '1', left: 0, top: 9},500)
$('.contact-content2').animate({opacity:'1'},500).animate({opacity: '0'},500)
$('.cardgreen > img').animate({height:150, width: 193, opacity: '0'},500).animate({opacity: '1', top: 9},500,
function() { $button.removeClass('disabled') }
);
}
}
});
$(document).(click(function() {
$button = $(this);
if (clickedc == 1){
if(!$button.hasClass('disabled')) {
$button.addClass('disabled');
clickedc = 0
$('.cardgreen > img').animate({opacity: '0'},300).animate({height:0,width:0});
$('.contact-content2').show(0).animate({opacity: '1'},300)
$('.clickding').animate({width: '0', height: '0'},0)
$('.card > img').animate({opacity: '1'},300)
.animate({opacity: '0', width: 0, height: 0, left:194, top:75},270,
function() { $button.removeClass('disabled') }
);
}
}
}));
所以我點擊div ..和動畫開始(淡入淡出)。然後它應該停止...然後用戶單擊文檔上的任何地方,第二個動畫(fadeout)應該開始。 - 但這不起作用..因爲當第二個動畫馬上開始後,我點擊Div淡入淡出動畫開始。 Theres no stop ..請幫我解決這個問題。JQuery 1點擊火災2條件(如果)
格式化您的代碼更嚴格一點可能有助於您的問題得到解答。 :) – 2010-12-02 14:52:11
有幾個;在這裏和那裏失蹤,這將無濟於事。另外,clickedc實際上並沒有被初始化,所以任何事情都可能發生。 – 2010-12-02 14:58:39