[問題] Slider IE8 無法顯示

看板Web_Design作者 (饅頭)時間11年前 (2014/08/23 12:00), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
小妹寫了一個slider在網頁上,但是IE8在顯示上會破掉... 但功力又不足以解決這個問題,所以來求助於大大們... 下面是js: ------------------------------------------------- $(document).ready(function () { // setting slider $('.slider').slider(); }); $.fn.slider = function (options) { this.each(function () { var settings = $.extend({ slider: $(this), }, options); settings.slider //向左轉 .on('click', '.arrow_l', function (e) { e.preventDefault(); //把箭頭隱藏 settings.slider.css('overflow', 'hidden'); //找到第一個商品,然後向左移 settings.slider.find('.product').first().animate({ 'margin-left': "-=140" }, 200, function () { //動完之後移除它的臨時style,然後把它移動到最右邊 settings.slider.removeAttr('style'); $(this).removeAttr('style'); $(this).appendTo($(this).parent()); }); }) //向右轉 .on('click', '.arrow_r', function (e) { e.preventDefault(); settings.slider.css('overflow', 'hidden'); settings.slider.find('.product').first().animate({ 'margin-left': "+=140" }, 200, function () { settings.slider.removeAttr('style'); $(this).removeAttr('style'); settings.slider.find('.product').last().prependTo($(this).parent()); }); }) }) } --------------------- 直覺反應是js有問題啦...但還希望大大們指點 ˊˋ...感謝了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.230.221 ※ 文章網址: http://www.ptt.cc/bbs/Web_Design/M.1408766420.A.1E0.html

08/23 13:02, , 1F
JQuery版本 ?
08/23 13:02, 1F
文章代碼(AID): #1J-17K7W (Web_Design)