的元件是在HTML由時間的document.ready(),但有一個與前一呼叫到「什麼滑塊」的問題。我做了如下評論,在做其他事之前檢查滑塊是否存在。現在工作。感謝您的幫助和建議Andy,即使這不是解決方案。
$(document).ready(function() {
if($('#slider').length > 0) {
$('#slider')
.anythingSlider({
navigationFormatter : function(index, panel){
return ['Slab', 'Parking Lot', 'Drive', 'Glorius Dawn', 'Bjork?', 'Traffic Circle'][index - 1];
},
buildStartStop: false,
buildNavigation: true,
autoPlay: true
})
.anythingSliderFx({
'.caption-top' : [ 'caption-Top', '50px' ],
})
}
//Add modal functionality where class is set
$('.modal-inline').colorbox({transition:'elastic', speed:500, width:'80%', height:'50%', inline:true});
$('.modal-image').colorbox({transition:'elastic', speed:500, width:'80%', height:'50%', inline:false});
$('.modal-image-square').colorbox({transition:'elastic', speed:500, width:'1000', height:'1000', inline:false});
});
我修復了儘可能多的驗證錯誤。其餘的與Cloudzoom相關,它的大型rel =「」屬性。有東西會被劫持嗎?我以前在這些類型的網站上使用過colorbox,並沒有問題。它可能是一個jQuery版本問題? – Jeepstone
不幸的是,頁面現在有一個UTF-8錯誤(可能是現在顯示爲缺失字符的'£')。驗證器無法解析非UTF-8字節。你也可以說是否你試圖綁定的''。colorbox()'是動態添加的還是PHP生成的頁面的一部分? – andyb
此外,頁面中的jQuery版本與colorbox示例中的版本相同,因此它不是jQuery版本問題。禁用其他插件是縮小問題的一個好方法,但我仍然認爲這是因爲綁定在控制檯中完成時是成功的,但它不在'$(document).ready();'中工作,就像你想要綁定的元素那時不存在一樣 – andyb