2014-10-17 70 views
-1

我寫了jQuery代碼來暫停和播放視頻。這裏我使用了embed標籤(而不是video標籤)。它在Chrome中工作,但不在Firefox中。關於滾動視頻暫停和使用javascript代碼

jQuery(document).ready(function(){ 
    jQuery(document).scroll(function() {  
     jQuery(".entry-content .wonderplugingallery").each(function(index){  
      var eTop = jQuery('.entry-content .html5gallery-container-'+index).offset().top;  
      var topy = eTop - jQuery(window).scrollTop();   
      if(topy>80 && topy<340){   
       jQuery(".html5gallery-container-"+index+" .html5gallery-video-play-"+index).trigger("click"); 
       jQuery(".html5gallery-container-"+index+" .html5boxPlayPause .html5boxPlay").trigger("click");   
      }else{   
       jQuery(".html5gallery-container-"+index+" .html5boxPlayPause .html5boxPause").trigger("click"); 
      } 
     }); 
    }); 
}); 

回答