Jquery mobile:如何在IE10中检测点击视频控制栏按钮?

时间:2013-05-25 16:41:02

标签: jquery jquery-mobile

当点击控制栏上的按钮时,我需要获取视频标签的ID 这适用于FF,但不适用于IE10。

<body>
    <div id='video1' class='catPage' data-role='page'>
        <ul id='ul_0' class='catList' data-role='listview' data-filter='true'>";
            <li class='linkCont'>
                <p class='linkpara'>Video1 Title</p>
                <div class='vidCont'>
                    <video id='video1' controls poster='video1_img' preload='metadata' width='224' height='128'>
                        <source src='videos/video1.ogv' type='video/ogg' />
                        <source src='videos/video1.webm' type='video/webm' />
                        <source src='videos/video1.mp4' type='video/mp4' />
                        Your browser does not support the video tag.
                    </video>
                </div>
            </li>
        </ul>
    </div>
</body>

<script>
    (function($){})(window.jQuery);// remap jQuery to $

    $(document).on('pageinit',function () {
        $("video").each(function(){
            $(this).on('click', function(event){
                console.log('vidTagId = ' + $(this).attr('id'));
         });
    });
</script>

1 个答案:

答案 0 :(得分:0)

试试这个:

$(document).ready(function(){
   $("video").each(function(){
        $(this).on('click', function(event){
            console.log('vidTagId = ' + $(this).attr('id'));
    });
});