Home Izo


European Travel Follow European Travel on WordPress.com Follow European Travel on WordPress.com Sorry, this product is unavailable. Please choose a different combination. ]]>

0){ load_extJS(); } if(wnw_opti_first_inner_js == false){ load_innerJS(); } if(mousemoveloadimg == false){ var top = this.scrollY; lazyloadimages(top); mousemoveloadimg = true; } } function load_innerJS(){ if(wnw_opti_first_inner_js == false){ for(var key in lazyload_inner_js){ if(lazyload_inner_js[key] != “”){ var s = document.createElement(“script”); s.innerHTML =lazyload_inner_js[key]; document.getElementsByTagName(“body”)[0].appendChild(s); } } wnw_opti_first_inner_js = true; } } function load_extJS() { if(wnw_opti_first_js == false && lazy_load_js.length > 0){ lazy_load_js.forEach(function(script) { var s = document.createElement(“script”); s[“type”] = “text/javascript”; for(var key in script){ console.log(key); s.setAttribute(key, script[key]); } console.log(s); document.getElementsByTagName(“head”)[0].appendChild(s); }); wnw_opti_first_js = true; } } var exclude_lazyload = null; var win_width = screen.availWidth; function load_extCss(){ if(wnw_opti_first_css == false && lazy_load_css.length > 0){ lazy_load_css.forEach(function(src) { var load_css = document.createElement(“link”); load_css.rel = “stylesheet”; load_css.href = src; load_css.type = “text/css”; var godefer2 = document.getElementsByTagName(“style”)[0]; if(godefer2 == undefined){ document.getElementsByTagName(“head”)[0].appendChild(load_css); }else{ godefer2.parentNode.insertBefore(load_css, godefer2); } }); wnw_opti_first_css = true; } } window.addEventListener(“scroll”, function(event){ var top = this.scrollY; lazyloadimages(top); lazyloadiframes(top); }); setInterval(function(){lazyloadiframes(top);},8000); setInterval(function(){lazyloadimages(0);},3000); function lazyload_img(imgs,bodyRect,window_height,win_width){ for (i = 0; i < imgs.length; i++) { if(imgs[i].getAttribute("data-class") == "LazyLoad"){ var elemRect = imgs[i].getBoundingClientRect(), offset = elemRect.top - bodyRect.top; if(elemRect.top != 0 && elemRect.top - window_height < 200 ){ /*console.log(imgs[i].getAttribute("data-src")+" -- "+elemRect.top+" -- "+window_height);*/ var src = imgs[i].getAttribute("data-src") ? imgs[i].getAttribute("data-src") : imgs[i].src ; var srcset = imgs[i].getAttribute("data-srcset") ? imgs[i].getAttribute("data-srcset") : ""; imgs[i].src = src; if(imgs[i].srcset != null & imgs[i].srcset != ""){ imgs[i].srcset = srcset; } delete imgs[i].dataset.class; imgs[i].setAttribute("data-done","Loaded"); } } } } function lazyload_video(imgs,bodyRect,window_height,win_width){ // for (i = 0; i < imgs.length; i++) { // var source = imgs[i].getElementsByTagName("source")[0]; // if(source.getAttribute("data-class") == "LazyLoad"){ // var elemRect = imgs[i].getBoundingClientRect(), // offset = elemRect.top - bodyRect.top; // // if(elemRect.top - window_height < 0 ){ // var src = source.getAttribute("data-src") ? source.getAttribute("data-src") : source.src ; // var srcset = source.getAttribute("data-srcset") ? source.getAttribute("data-srcset") : ""; // imgs[i].src = src; // if(source.srcset != null & source.srcset != ""){ // source.srcset = srcset; // } // delete source.dataset.class; // source.setAttribute("data-done","Loaded"); // } // } // } } function lazyloadimages(top){ var imgs = document.getElementsByTagName("img"); var ads = document.getElementsByClassName("lazyload-ads"); var sources = document.getElementsByTagName("video"); var bodyRect = document.body.getBoundingClientRect(); var window_height = window.innerHeight; var win_width = screen.availWidth; lazyload_img(imgs,bodyRect,window_height,win_width); lazyload_ads(ads,bodyRect,window_height,win_width); lazyload_video(sources,bodyRect,window_height,win_width); } function lazyload_ads(ads,bodyRect,window_height,win_width){ for (i = 0; i < ads.length; i++) { var classname = ads[i].className; if(classname.trim() == "lazyload-ads"){ var elemRect = ads[i].getBoundingClientRect(), offset = elemRect.top - bodyRect.top; if(elemRect.top != 0 && elemRect.top - window_height < 0 ){ var id = ads[i].id ; for (j = 0; j -1){ var s = document.createElement("script"); var code = str; s.onload = function(){ console.log("loaded"); } try { s.appendChild(document.createTextNode(code)); document.getElementsByTagName("head")[0].appendChild(s); } catch (e) { s.text = code; document.getElementsByTagName("head")[0].appendChild(s); } /*document.getElementsByTagName("head")[0].appendChild(s);*/ break; } } delete ads[i].classList.remove("lazyload-ads"); } } } } lazyloadimages(0); function lazyloadiframes(top){ var bodyRect = document.body.getBoundingClientRect(); var window_height = window.innerHeight; var win_width = screen.availWidth; var iframes = document.getElementsByTagName("iframe"); lazyload_img(iframes,bodyRect,window_height,win_width); }]]>

Source

Leave a Comment

Your email address will not be published.

Translate »