我有一個網頁顯示從類別職位的滑塊。當用戶點擊「下一個類別」時,內容會左移,並且新內容會隨其滑塊一起加載。.load()不喜歡我的滑塊
這.load()正在對同一頁面的請求,使用不同的參數(真的不知道這是否是相關的問題)。
問題是,所裝載的滑塊不起作用。你可以看到它here,點擊右上角的箭頭,你會看到我的問題。
這是我使用的腳本:
function carousels(){
if ($("#projectos-carousel").length) {
$("#projectos-carousel").carouFredSel({
items: { visible: 5 },
circular: false,
infinite: false,
auto: false,
prev: { button : "#prev-proj" },
next: { button : "#next-proj" },
pagination : "#pager-proj",
});
}
}
...
$('.right-trigger').click(function() {
var toLoad = $(this).attr('href')+' #container';
$('#container').attr('id','to-go');
$('#to-go').css({'position': 'absolute'});
$('#wrapper').append('<div id="newcontainer"/>');
$('#newcontainer').load(toLoad, function() {
$('#newcontainer').append($('#container').children()).css({'position': 'absolute', 'left': '942px'});
$('#to-go, #newcontainer').animate({left:'-=937'},600, function() {
$('#to-go').remove();
});
$('#container').remove();
$('#newcontainer').attr('id','container');
searchform();
triggers();
carousels();
});
return false;
});
searchform()和觸發器()函數的工作,但沒有轉盤()。我已經嘗試過使用setTimeout();與旋轉木馬()在代碼的最後部分,但它只適用於此example,而不是我真正想要的地方。
謝謝你的時間!
爲什麼使用PHP標記? – DampeS8N
這就是「(不知道這是否與問題相關)」。請求是「projectos.php?catProj = 1」。 – danielcorreia
在'carousels'函數內部,添加這個作爲第一行'alert($(「#projectos-carousel」)。)併發布結果。 –