jQuery Slider не работает в Internet Explorer

http://jsfiddle.net/r7MgY/19423/

Кто-нибудь знает, почему этот слайдер не будет работать в IE7 - 9? Это как-то связано с несколькими классами для слайдов? Я исследовал все на наличие ошибок, и я не могу найти ответ.

Любая помощь будет оценена. Благодарю.

JQuery 1.9.1 код:

$('#menu ul li.menuItem:first').addClass('act').siblings().addClass('inact');
/* On page load, mark the first thumbnail as active */

var totWidth=0;
var positions = new Array();

$('#slides .slide').each(function(i){
    // Loop through all the slides and store their accumulative widths in totWidth
    positions[i]= totWidth;
    totWidth += $(this).width();
    // The positions array contains each slide's cumulutative offset from the left part of the container

    if(!$(this).width())
    {
        console.log("Please, fill in width & height for all your images!");
        return false;
    }
});

$('#slides').width(totWidth);
// Change the container div's width to the exact width of all the slides combined


//get active thumb
var activeThumb = $('#menu ul li.act');
var nextThumb = activeThumb.next('li.inact');
var firstThumb = $('#menu ul li:first');

var addAct = function(slid){
    slid.removeClass('inact').addClass('act');
};
var removeAct = function(slid){
    slid.removeClass('act').addClass('inact');
    console.log('worked');
};

function nextSlide(){
    //get current thumb
    var activeThumb = $('#menu ul li.act');
    //get next thumb
    var nextThumb = activeThumb.next();
    //first
    var firstThumb = $('#menu ul li:first');

    if(nextThumb.length == 0){
        nextThumb = false;
        removeAct(activeThumb);
        addAct(firstThumb);
        firstThumb = activeThumb;
        //move Main image to first
        $('#slides').stop(false, true).animate({marginLeft: 0 + 'px'}, 350);
    } else {
        removeAct(activeThumb);
        addAct(nextThumb);
        //move Main image
        $('#slides').stop(false, true).animate({marginLeft: '-=200' +'px'}, 350);
    }
};

/*Execute Next Slide to next button*/
$('#nav li#next a').click(nextSlide);

0 ответов

Другие вопросы по тегам