1

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. It works fine when I test it in Chrome, but when I try it in ios, it doesn't. It loads the video before it removes it from the screen.

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 :

#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...

Nata2ha Mayan2
  • 474
  • 1
  • 10
  • 23

1 Answers1

3

jQuery.click() doesn't function properly on iOS. I suspect that you're having the same problem with bind().

You might be able to use jQuery.on() or by using other events like touchstart

I saw this post which seems to be similar to your problem

Community
  • 1
  • 1
GrayB
  • 1,010
  • 8
  • 22
  • okay, just that really helped. I actually ended up using `touchstart`, but i didn't know that the jQuery.click() function didn't work. thanks – Nata2ha Mayan2 May 18 '12 at 22:59