作者mbrathebest (馒头)
看板Web_Design
标题[问题] Slider IE8 无法显示
时间Sat Aug 23 12:00:17 2014
小妹写了一个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://webptt.com/cn.aspx?n=bbs/Web_Design/M.1408766420.A.1E0.html
1F:→ lNishan: JQuery版本 ? 08/23 13:02