Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 我不能让它在iPad、iPod和iPhone上工作_Jquery_Ipad_Mobile_Scroll - Fatal编程技术网

Jquery 我不能让它在iPad、iPod和iPhone上工作

Jquery 我不能让它在iPad、iPod和iPhone上工作,jquery,ipad,mobile,scroll,Jquery,Ipad,Mobile,Scroll,我在这个网站上工作 我正在使用jQuery、MagicScroll和TimeLineMax。这是指向MagicScroll的链接 我的问题是,在尝试通过safari MagicScroll进行调试后,我不明白为什么在iPad、iPod或iPhone上滚动刷不起作用。我真的希望你们能帮助我,非常感谢。问我更多的信息 if(Modernizr.touch) { var myScroll; $(document).ready(function () {

我在这个网站上工作

我正在使用jQuery、MagicScroll和TimeLineMax。这是指向MagicScroll的链接

我的问题是,在尝试通过safari MagicScroll进行调试后,我不明白为什么在iPad、iPod或iPhone上滚动刷不起作用。我真的希望你们能帮助我,非常感谢。问我更多的信息

if(Modernizr.touch) {
        var myScroll;
        $(document).ready(function () {
            // wrap for iscroll
            $("#content-wrapper")
                .addClass("scrollContainer")
                .wrapInner('<div class="scrollContent"></div>');

            // init the controller
            controller = new ScrollMagic({
                container: "#content-wrapper",
                globalSceneOptions: {
                    triggerHook: "onLeave"
                }
            });

            // add iScroll
            myScroll = new IScroll('#content-wrapper', {scrollX: false, scrollY: true, scrollbars: true, useTransform: false, useTransition: false, probeType: 3});

            // update container on scroll
            myScroll.on("scroll", function () {
                controller.update();
            });

            // overwrite scroll position calculation to use child's offset instead of parents scrollTop();
            controller.scrollPos(function () {
                return -myScroll.y;
            });

            // refresh height, so all is included.
            setTimeout(function () {
                myScroll.refresh();
            }, 0);

            $("#content-wrapper").on("touchend", "a", function (e) {
                // a bit dirty workaround for links not working in iscroll for some reason...
                e.preventDefault();
                if($(this).hasClass('arrow'))
                    $(this).trigger('click');
                else
                    window.location.href = $(this).attr("href");
            });

            // manual set hight (so height 100% is available within scroll container)
            $(document).on("orientationchange", function () {
            $("section")
                .css("min-height", $(window).height())
                .parent(".scrollmagic-pin-spacer").css("min-height", $(window).height());
            });
            $(document).trigger("orientationchange"); // trigger to init

            document.documentElement.ontouchstart = true;
            document.addEventListener('touchmove',function(e) {
                e.preventDefault();
                var touch = e.touches[0];
                // window.console.log(touch.pageX + " - " + touch.pageY);
            }, false);
            document.addEventListener('touchstart', function(e) {
                e.preventDefault();
                var touch = e.touches[0];
                //This works! But site doesn't scroll
                window.console.log(touch.pageX + " - " + touch.pageY);
            }, false);

        });
    } else {
        // init the controller
        controller = new ScrollMagic({
            globalSceneOptions: {
                triggerHook: "onLeave"
            }
        });
    }

我希望你能帮助我,谢谢

在此处提供滚动条的代码部分。。
$(document).ready(function() {
        pin = new TimelineMax()
            .add(TweenMax.from("#homeSlide1", 0.5, {top: "0%", marginTop: 0}))
            .add([
                TweenMax.to("#homeSlide1", 1, {left:'-'+$(window).width()+'px'}),
                TweenMax.to("#homeSlide2", 1, {left:'0px'})
            ])
            .add(TweenMax.to("#homeSlide3", 1, {left:'0px'}))
            .add(TweenMax.to("#homeSlide4", 1, {left:'0px'}))

        scene = new ScrollScene({
            triggerElement: "section#Home",
            duration: $(window).innerHeight()
        })
        .on("progress", function () {})
        .setTween(pin)
        .setPin("section#Home")
        .addTo(controller);
});