Код: Выделить всё
jQuery(window).on("load", function() {
var distance = jQuery('#page00').offset().top;
jQuery(window).scroll(function () {
if (jQuery(window).scrollTop() >= distance) {
if (jQuery("#page00").hasClass("stopVid")) {}else{
jQuery('#page00').addClass("stopVid");
jQuery("#videoHero0").get(0).play();
}
} else {
jQuery('#page00').removeClass("stopVid");
}
});
} );
Текущий код:
Код: Выделить всё
jQuery(window).on("load", function() {
var distance = jQuery('#page00').offset().top;
jQuery(window).scroll(function () {
if (jQuery(window).scrollTop() >= distance) {
if (jQuery("#page00").hasClass("stopVid")) {}else{
jQuery('#page00').addClass("stopVid");
jQuery("#videoHero0").get(0).play();
}
} else {
jQuery('#page00').removeClass("stopVid");
}
});
} );Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/787 ... le-devices