内容在IE10 / IE9 scrolllorama上移动怪异

时间:2013-06-13 19:32:50

标签: jquery html css jquery-plugins

我目前正在开发此网站

http://remedia-solutions.com/clientes/0093_Construdeck/Final2/

我正在向上和向左移动内容。在Chrome,Safari上运行得很好,但它在IE上移动得非常奇怪。

继承我的JS for scrollorama。

scrollorama.animate('#entrada',{delay:100,duration: 100, property:"opacity", start:1, end:0 });
scrollorama.animate('#entrada',{delay:100,duration: 100, property:"z-index", start:1, end:0 });
scrollorama.animate('#interiortotal',{duration: 2900, property:"top", start:"0px", end:"-5340px"});
scrollorama.animate('#interiortotal',{duration: 2900, property:"left", start:"0px", end:"5340px"});

编辑:我决定使用这个JS,它解决了问题,但它不适用于touchscroll鼠标。

if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false);
    window.onmousewheel = document.onmousewheel = wheel;

    function wheel(event) {
        var delta = 0;
        if (event.wheelDelta) delta = event.wheelDelta / 120;
        else if (event.detail) delta = -event.detail / 3;

        handle(delta);
        if (event.preventDefault) event.preventDefault();
        event.returnValue = false;
    }

    function handle(delta) {
        var time = 1000;
        var distance = 250;

        $('html, body').stop().animate({
            scrollTop: $(window).scrollTop() - (distance * delta)
        }, time, "easeInOutQuart");
    }

0 个答案:

没有答案