vanilla-lazyload
2 months ago
jquery.lazy.av.min.js
4 years ago
jquery.lazy.iframe.min.js
4 years ago
jquery.lazy.js
3 years ago
jquery.lazy.min.js
3 years ago
lazyload.min.js
4 years ago
loader.js
3 years ago
two_delay.js
2 years ago
two_elementor_video_to_iframe.js
4 years ago
two_lazyload.js
3 years ago
two_merge_google_font_faces.js
3 years ago
two_worker.js
2 years ago
two_yt_vi_lazyload.js
3 years ago
two_yt_vi_lazyload.min.js
3 years ago
two_lazyload.js
46 lines
| 1 | jQuery("document").ready(function () { |
| 2 | jQuery("*:not('br, hr, iframe, pre')").each(function () { |
| 3 | let bg_image_data = get_bg_images(this); |
| 4 | if (bg_image_data) { |
| 5 | jQuery(this).addClass("two_bg"); |
| 6 | jQuery(this).attr("data-src", bg_image_data['first_bg_image']); |
| 7 | jQuery(this).attr("data-full-bg-image", bg_image_data['bg_image_property']); |
| 8 | jQuery(this).on('visibility', function () { |
| 9 | var $element = jQuery(this); |
| 10 | setInterval(function () { |
| 11 | jQuery('.two_bg').Lazy({ |
| 12 | visibleOnly: true, |
| 13 | }); |
| 14 | }, 300); |
| 15 | }).trigger('visibility'); |
| 16 | } |
| 17 | }); |
| 18 | |
| 19 | jQuery('.two_bg').Lazy({ |
| 20 | visibleOnly: true, |
| 21 | }); |
| 22 | |
| 23 | function get_bg_images(elem) { |
| 24 | let style = elem.currentStyle || window.getComputedStyle(elem, false); |
| 25 | let bg_image = style.backgroundImage; |
| 26 | |
| 27 | if (bg_image === 'none' || bg_image.indexOf(window['two_svg_placeholder']) === -1) { |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | bg_image = bg_image.replace(window['two_svg_placeholder'], ""); |
| 32 | if (!bg_image) { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | let first_bg_image = bg_image.slice(5, bg_image.length).split('")')[0]; |
| 37 | return { |
| 38 | "first_bg_image": first_bg_image, |
| 39 | "bg_image_property": bg_image |
| 40 | } |
| 41 | |
| 42 | } |
| 43 | |
| 44 | }); |
| 45 | |
| 46 |