我有選項卡架構,它很好地工作,但我想要一個信息div出現在每個選項卡內幾秒鐘,並且沒有任何交互滑動。這是我的標籤腳本:嵌套jQuery動畫
$(document).ready(function() {
$("#temascont").find("[id^='cont']").hide(); // Hide all tabs
$("#menucont li:first").attr("id","actual"); // Activate first tab
$("#temascont #cont0").fadeIn(); // Display the first tab's contents
$('#menucont a').click(function(e) {
e.preventDefault();
if ($(this).closest("li").attr("id") == "actual"){ // Find the actual tab
return;
}
else{
$("#temascont").find("[id^='cont']").hide(); // Hide all the content
$(this).parent().attr("id","actual"); // Activate the actual Div
$("#menucont li").attr("id",""); //Resetting all id's
$('#' + $(this).attr('name')).fadeIn(); // Show content for the actual tab
}
});
});
到目前爲止好,現在這是我要嵌套的動畫。
$(".addsmin").delay(1500).animate({left:"-200"},{duration:300});
如果我把它在當我點擊任何含過渡DIV(.addsmin)選項卡中只能出現一次初始功能的開始,如果把它放在別的括號內同樣的情況。
什麼說你,這可能嗎?
這裏的小提琴:http://jsfiddle.net/roec4h4z/
請澄清這個問題,這是如此不清楚! – 2014-09-24 06:58:29
當你有一個JavaScript問題時,如果你可以給一個jsFiddle提供一個工作示例(嘗試或僅僅是樣板)讓我們開始調整,那真是太棒了。 – 2014-09-24 07:00:39
:)謝謝你,這裏的小提琴:http://jsfiddle.net/roec4h4z/ – 2014-09-24 07:14:17