301}302};303304SequenceController.prototype.stopSequence = function (sequenceObject) {305if (sequenceObject.started == false) {306return;307}308sequenceObject.items.forEach(function (el) {309el.backgroundHolder.style.position = 'relative';310el.backgroundHolder.style.display = 'block';311el.backgroundHolder.style.opacity = 1;312});
document.body.style.backgroundColor = sequenceObject.prevBackgroundColor; sequenceObject.started = false;};SequenceController.prototype.scrollCb = function () { for (var i = 0, l = this.sequenceObjects.length, sO; i < l; i++) { sO = this.sequenceObjects[i]; var boundingRect = sO.sequenceHolder.getBoundingClientRect(); if (boundingRect.top < 0 && boundingRect.bottom > 0 && boundingRect.bottom > boundingRect.height - sO.sequenceHeight - 100) { this.processSequence(sO); } else { this.stopSequence(sO); } }};SequenceController.prototype.setScrollCb = function () { this._scrollCb = jQuery.proxy(this.scrollCb, this); /*.bind(this);*/ $(window).scroll(this._scrollCb); // $(window).bind('scroll', t_throttle(this._scrollCb, 200));};window.sequenceController = new SequenceController();function t_onFuncLoadVideo(okFunc) { if (typeof $.fn.videoBG === 'function') { okFunc(); } else { setTimeout(function checkFuncExist() { if (typeof $.fn.videoBG === 'function') { okFunc(); return; } if (document.readyState === 'complete' && typeof $.fn.videoBG !== 'function') { throw new Error('$.fn.videoBG' + ' is undefined'); } setTimeout(checkFuncExist, 100); }); }}