0

これは、jQueryとChromeの位置に関する別のスレッドです:D。私はいくつか読んだが、解決策を見つけることができなかった。

function sliderCarousel(){

var count = $('#liste2').children().length; // Numbers of Elements in the Slider
var jump = $('#liste2 li:first').outerWidth(true); // Width of a single Element, including Margin(!)
var resultWidth = count * jump; // Width of all Elements in the Slider.
$('#liste2').width(resultWidth); // Sets the width of the ul to the calculated. Because the slider should work with a various number of Elements
                                 // you cant set a default width.
var unseenElementsNumber = Math.round((-1)*(resultWidth - $('#ein').width())/jump) - 1; // calculates the number of Sliderelements, which are hidden
var unseenElementsWidth = unseenElementsNumber * jump; // calculates the widht of unseen elements

    if(unseenElementsNumber >= 0)
    {
        $('#go').click(function() //rotate left
        {
            if(parseInt($('#liste2').css("left").replace("px","")) + 80 <= 0) // needed to prevent "overscrolling"
            {   
                $('#liste2').animate({
                "left": "+="+jump+"",
                }, 500 ); // speed of rotation
            }
        });

        $('#back').click(function() // rotate right
        {
            if(parseInt($('#liste2').css("left").replace("px","")) - 80 >= unseenElementsWidth) // needed to prevent "overscrolling"
            {   
                $('#liste2').animate({
                "left": "-="+jump+"",
                }, 500 ); // speed of rotation
            }
        });

        $('#start').click(function() //Return to start
        {
            $('#liste2').animate({
                "left": "0px",
                }, 500 ); // speed of rotation
        });
    }

}

これが私のコードです。FFではうまく機能しますが、Chromeでは機能しません。何か案は?

4

0 に答える 0