This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.loadPicturePluginClick').click(function(){ | |
$('#lo').loadPicture(function(){ | |
console.log('Picture Loaded'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture id="lo"> | |
<source media="(min-width: 1280px)" data-srcset="./assets/images/compressed/chrome-wallpaper.webp" type="image/webp"> | |
<source media="(min-width: 1280px)" data-srcset="./assets/images/compressed/chrome-wallpaper.jpg" type="image/jpg"> | |
<source media="(min-width: 1152px)" data-srcset="./assets/images/compressed/size-90/chrome-wallpaper.webp" type="image/webp"> | |
<source media="(min-width: 1152px)" data-srcset="./assets/images/compressed/size-90/chrome-wallpaper.jpeg" type="image/jpeg"> | |
<source media="(min-width: 1088px)" data-srcset="./assets/images/compressed/size-85/chrome-wallpaper.webp" type="image/webp"> | |
<source media="(min-width: 1088px)" data-srcset="./assets/images/compressed/size-85/chrome-wallpaper.jpeg" type="image/jpeg"> | |
<source media="(min-width: 1024px)" data-srcset="./assets/images/compressed/size-80/chrome-wallpaper.webp" type="image/webp"> | |
<source media="(min-width: 1024px)" data-srcset="./assets/images/compressed/size-80/chrome-wallpaper.jpeg" type="image/jpeg"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.loadImagePluginClick').click(function(){ | |
$('.loadImagePlugin').loadImage(function(){ | |
alert('Image Loaded'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img class="loadImagePlugin" style="max-width:100%;" data-src="./assets/images/compressed/chrome-wallpaper.jpg" data-webp="./assets/images/compressed/chrome-wallpaper.webp" alt="Chrome Wallpaper for Lazy Load Example" title="Example Image: Img Tag lazy Load" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.viewportWatcherExampleTrigger').viewportWatcher(function() { | |
// Element is in the Viewport Do Something | |
$(this).find('.viewportWatcherExample').fadeIn('slow'); | |
}, function() { | |
// Element is out of the Viewport Do Other Thing | |
let display = $(this).css('display'); | |
if (display != "none") { | |
$(this).find('.viewportWatcherExample').fadeOut('fast'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col-100 demo viewportWatcherExampleTrigger"> | |
<div class="viewportWatcherExample" style="width:100%;height:400px;background-color:red;margin:40px 0;display:none;"> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#checkIfIsOnViewport').click(function(){ | |
$('.testToSeeIfIsOnViewport').OnViewport(function(){ | |
// Element is on viewport | |
// alert("Element Is On Window Viewport"); | |
console.log($(this)); | |
$(this).fadeOut(); | |
},function(){ | |
// Element is not on Viewport | |
// alert("Element is not on Window Viewport"); | |
console.log($(this)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="testToSeeIfIsOnViewport" style="width:100%;height:400px;background-color:red;margin:40px 0;"> | |
</div> | |
<button id="checkIfIsOnViewport"> | |
Check If Element is on Viewport | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe data-type="iframe" data-method="click" data-trigger="#loadIframe" data-src="./iframe-lazy-load.html" ></iframe> | |
<button id="loadIframe">Load Iframe</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe data-type="iframe" data-method="viewport" data-src="./iframe-lazy-load.html" ></iframe> |
NewerOlder