0

Okay, I got an div#outer with a width of 200px e.g.
In this div is another wider div, which has a width of 1200px.

To keep it simple this values are fix, in real this will be calculated.

The outer div has "overflow:scroll" so the user can scroll from left to right.
On init the inner div scrolls to a specific position.
This all works good, but why not in IE9 ?

I've made a fiddle, eventually someone has an idea whats going on in IE there.

http://jsfiddle.net/3GZYy/1/

var scrollOffset = parseInt(1255.3453 - 422.3453);

$('#outer').animate({
    scrollLeft: scrollOffset
}, 250, function() {
    // animation is over
    // createChartNavi();
});
chris
  • 4,827
  • 6
  • 35
  • 53

1 Answers1

2

Your console.log is causing IE9 not to run the animation, try removing it:

$(function() {
    // Handler for .ready() called.


    // is ready
    var scrollOffset = parseInt(1255.3453 - 422.3453);

    $('#outer').animate({
        scrollLeft: scrollOffset
    }, 250, function() {
        // animation is over
        // createChartNavi();
    });
});

DEMO

Adrian Forsius
  • 1,437
  • 2
  • 19
  • 29
  • Thanks for ya answer. In the demo it works, but in my scripts is no console.log :-/ do you got another idea? – chris Jun 24 '14 at 14:01
  • Since you are working with IE9 in the Demo my first thought is that your IE-cache is messing with you, try clearing your cache otherwise I would need more information on what could cause this to fail. – Adrian Forsius Jun 24 '14 at 14:07
  • Hm, no the cache is not. Only thing I would imagine is that IE renders the HTML later and the elements not exists at this point. Don´t know, I disregard this for now. – chris Jun 24 '14 at 14:11