0
我遇到了IE和我的jQuery問題。jQuery滑塊和IE9 - 追加和可能出現的問題
我使用這個WordPress安裝滑塊插件,和我加載下面的代碼來創建自定義2上一張/下一個按鈕:
jQuery(document).ready(function($) {
var sliderInstance = $("#touchcarousel-1, #touchcarousel-2, #touchcarousel-3, #touchcarousel-4, #touchcarousel-5, #touchcarousel-6").data("touchCarousel");
$("body").append('<a href="#" class="arrowleft"><img src="/wp-content/themes/revisor/images/left.png" /></a><a href="#" class="arrowright"><img src="/wp-content/themes/revisor/images/right.png" /></a>');
var arrleft = $(".arrowleft")
arrright = $(".arrowright");
var wrapoffset = $("#wrap").offset();
console.log(wrapoffset.left);
arrleft.css("left" , wrapoffset.left-100);
arrright.css("right" , wrapoffset.left-100);
arrleft.click(function(e)
{
e.preventDefault();
sliderInstance.prev();
});
arrright.click(function(e)
{
e.preventDefault();
sliderInstance.next();
});
$(window).resize(function() {
var wrapoffset = $("#wrap").offset();
arrleft.css("left" , wrapoffset.left-100);
arrright.css("right" , wrapoffset.left-100);
});
});
在FF和鉻,這工作得很好,但不在IE中(在IE9中測試)。
我很難過,因爲沒有任何按鈕上的命令可以工作 - 既不是CSS也不是事件。
這裏看到的網頁:http://revisor-faellesskabet.dk/skat/
謝謝 - 我會記住的! – Hauthorn