简体   繁体   English

功能不正常的ios5 iPad工作

[英]functions not working in proper order of ios5 iPad

I have a set of functions that are supposed to be working onclick, and then a few more that are binded to html5 video events. 我有一组应该正常工作的函数,然后还有一些与html5视频事件绑定的函数。 It works fine when I test it in Chrome, but when I try it in ios, it doesn't. 当我在Chrome中测试它时,它工作正常,但是当我在ios中尝试它时,它没有。 It loads the video before it removes it from the screen. 它会在将视频从屏幕上移除之前加载视频。

JS : JS:

$(document).ready(function () {
    $('#MyT').fadeOut();
    <!--$('#myVid').addClass('move');

    $('li, .thumbs').bind('click', function() {
        $("#bigPic").removeClass('move');

        var numb = $(this).index(),
            videos = ['images/talking1.m4v', 'images/talking2.m4v', 'images/talking1.m4v', 'images/talking2.m4v', 'images/talking1.m4v', 'images/talking2.m4v'],
            myVideo = document.getElementById('myVid');
            myVideo.src = videos[numb];
            myVideo.load();
        setTimeout(function(){
            myVideo.play();
        }, 200);
    });

    $('#myVid').bind("loadeddata", function() {
        $('#bigPic').addClass('move').delay(200);
    });


    $('#myVid').bind("playing", function() {
        ("#myVid").removeClass('move');

    });

    $('#myVid').bind("ended", function () {
        $("#bigPic").removeClass('move');
    });
});
});

CSS : CSS:

#bigPic {
    position:absolute;
 /* margin-left:-8px;   
    margin-top:-16px; */
    height:768px;   
    width:1024px;
    left:1200px;
    oveflow: hidden;    
}

.move {
    -webkit-transform: translateX(-1200px);
}

Edit I found out that the removeClass in the .bind('click') in the begining is not actually doing anything... 编辑我发现在removeClass.bind('click')中的removeClass实际上并没有做任何事情......

jQuery.click() doesn't function properly on iOS. jQuery.click()在iOS上无法正常运行。 I suspect that you're having the same problem with bind(). 我怀疑你遇到了与bind()相同的问题。

You might be able to use jQuery.on() or by using other events like touchstart 您可以使用jQuery.on()或使用touchstart等其他事件

I saw this post which seems to be similar to your problem 我看到这篇文章似乎与你的问题相似

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM