Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
public_html
/
wp-content
/
plugins
/
element-ready-lite
/
assets
/
js
/
Editing: sticky_video.js
!function(e){"use strict";var t=function(e){this.containerId=e||"sticky-container",this.container=document.getElementById(this.containerId),this.initialize()};function n(e,t){return new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)}t.addClass=function(e,t){if(n(e,t))return;if(!e)return;"string"==typeof e?e=document.querySelectorAll(e):e.tagName&&(e=[e]);for(var i=0;i<e.length;i++)(" "+e[i].className+" ").indexOf(" "+t+" ")<0&&(e[i].className+=" "+t)},t.removeClass=function(e,t){if(!n(e,t))return;if(!e)return;"string"==typeof e?e=document.querySelectorAll(e):e.tagName&&(e=[e]);for(var i=new RegExp("(^| )"+t+"($| )","g"),r=0;r<e.length;r++)e[r].className=e[r].className.replace(i,"")},t.hasClass=n,t.wrap=function(e,t){return t.appendChild(e)},t.insertAfter=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},t.prototype.fixElementHeight=function(){this.container.parentElement.style.height=this.container.parentElement.offsetHeight+"px"},t.prototype.elementInViewport=function(e){return e.getBoundingClientRect().top>-1*e.offsetHeight},t.prototype.initialize=function(){if(!this.container)return;var e=this,n=document.createElement("div");function i(){e.fixElementHeight();var i=n;e.elementInViewport(i)?(t.removeClass(i,"sticky-container_sticky"),t.addClass(i,"sticky-container_in-content")):(t.removeClass(i,"sticky-container_in-content"),t.addClass(i,"sticky-container_sticky"))}n.className="sticky-container__wrap",this.container.parentElement.insertBefore(n,this.container),t.insertAfter(n,e.container),t.wrap(e.container,n),t.addClass(n,"sticky-container_in-content"),t.addClass(e.container,"sticky-container__video"),window.addEventListener?window.addEventListener("scroll",i):window.onscroll=i},"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.StickyVideo=t):e.StickyVideo=t}(this);
Save
Cancel