此代碼適用於可篩選的產品組合。最初我有PHP的下一個和以前的鏈接,但是當組合被過濾時,它不會找到下一個過濾的對象。我發現過濾器將列表項放置在DOM中彼此相鄰,所以我使用next()來獲得結果。但是,鏈接沒有正確加載。它是加載thickbox的同一頁面上的鏈接。我已經成功地將它打開到一個新的窗口並附加到窗口url,但沒有骰子試圖讓它工作。這是所述投資組合的地址。在同一頁面中加載鏈接jQuery
http://blurosemedia.com/portfolio
$(document).ready(function(){
$(".portfolio-next").click(function(e) {
var $this = $(this);
if($this.data('clicked', true)) {
var namer = $(this).attr('value');
var url = $(this).parents('body').children('#wrap').children('#inner').children('#content-sidebar-wrap').children('#content').children('ul#portfolio-list').children().next('.portfolio-item-' + namer).nextAll('.portfolio-item:not(:.isotope-hidden)').attr('id');
window.location.load(url);
e.preventDefault();
}
});
});
我不得不爬上一路上揚,道指樹,因爲ThickBox的代碼會自動顯示在頁面的底部。我認爲一種可能的解決方案是爲了讓thickbox加載你必須有class =「thickbox」。如果我能以某種方式說load(url).withClass('thickbox')它可能工作,但我確定語法應該如何。