Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="slider">
- <img src="images/slide1.jpg" alt="" />
- <a href="http://dev7studios.com"><img src="images/slide2.jpg" alt="" title="#htmlcaption" /></a>
- <img src="images/slide3.jpg" alt="" title="This is an example of a caption" />
- <img src="images/slide4.jpg" alt="" />
- </div>
- $(function(){
- $.each(document.images, function(){
- var this_image = this;
- var src = $(this_image).attr('src') || '' ;
- if(!src.length > 0){
- //this_image.src = options.loading; // show loading
- var lsrc = $(this_image).attr('lsrc') || '' ;
- if(lsrc.length > 0){
- var img = new Image();
- img.src = lsrc;
- $(img).load(function() {
- this_image.src = this.src;
- });
- }
- }
- });
- });
- <div id="slider">
- </div>
- jQuery(function(){
- $("#slider").append('<img src="images/slide1.jpg" alt="" />');
- });
- $(window).load(function () {
- // run code
- });
- var image = new Image();
- image.src = "/path/to/huge/file.jpg";
- image.onload = function() {
- ...
- }
- <img class="b-lazy"
- src="placeholder-image.jpg"
- data-src="image.jpg"
- data-src-small="small-image.jpg"
- alt="Image description" />
- var bLazy = new Blazy({
- breakpoints: [{
- width: 420 // Max-width
- , src: 'data-src-small'
- }]
- , success: function(element){
- setTimeout(function(){
- // We want to remove the loader gif now.
- // First we find the parent container
- // then we remove the "loading" class which holds the loader image
- var parent = element.parentNode;
- parent.className = parent.className.replace(/bloadingb/,'');
- }, 200);
- }
- });
- <script type="text/javascript">
- jQuery(function(){
- //your function implementation here...
- });
- </script>
Add Comment
Please, Sign In to add comment