Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Requests
Lazy Load & Filtering
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Kurumi" data-source="post: 473724" data-attributes="member: 61623"><p>My advice is to use a github library.</p><p>Very light as jquery code</p><p>[URL unfurl="true"]http://jquery.eisbehr.de/lazy/[/URL]</p><p></p><p>The implementation is very simple.</p><p>You can also create the function to tell a specific element to load your Lazy.</p><p></p><p>Be horizontal or vertical.</p><p>So if you have for example Ajax</p><p>you must specify your class or id of your ajax images</p><p></p><p>The rest is the invisible line if you do not have the element on your screen that does not load.</p><p>If you make for example a pagination and go to page 2 this will load.</p><p></p><p>Ex:</p><p>Instance:</p><p>[ICODE]</p><p></p><p></p><p> $('.lazy').Lazy({</p><p> // your configuration goes here</p><p> scrollDirection: 'vertical',</p><p> effect: 'fadeIn',</p><p> visibleOnly: true,</p><p> onError: function(element) {</p><p> console.log('error loading ' + element.data('src'));</p><p> }</p><p> });</p><p>[/ICODE]</p><p></p><p>Parameter class optional:</p><p>[ICODE]</p><p></p><p></p><p> var lazy = $('.lazy').Lazy({ chainable: false });</p><p></p><p> var attributeName = lazy.config('attribute'); // get</p><p> lazy.config('effect', 'show');</p><p>[/ICODE]</p><p></p><p>[ICODE]</p><p> // 'config' can receive entries or set them to a new value</p><p> var value = instance.config('attribute');</p><p> instance.config('attribute', 'data-new-attribute');</p><p></p><p> // 'addItems' works with an jQuery object or any selector</p><p> // so these two lines have the exact same result</p><p> instance.addItems('img.new-items');</p><p> instance.addItems($('img.new-items'));</p><p>[/ICODE]</p><p></p><p>img atribute lazy or background automatily style</p><p>[ICODE]</p><p><div class="lazy" data-loader="customLoaderName"></div></p><p></p><p> <img class="lazy" data-src="path/to/image.jpg" /></p><p>[/ICODE]</p></blockquote><p></p>
[QUOTE="Kurumi, post: 473724, member: 61623"] My advice is to use a github library. Very light as jquery code [URL unfurl="true"]http://jquery.eisbehr.de/lazy/[/URL] The implementation is very simple. You can also create the function to tell a specific element to load your Lazy. Be horizontal or vertical. So if you have for example Ajax you must specify your class or id of your ajax images The rest is the invisible line if you do not have the element on your screen that does not load. If you make for example a pagination and go to page 2 this will load. Ex: Instance: [ICODE] $('.lazy').Lazy({ // your configuration goes here scrollDirection: 'vertical', effect: 'fadeIn', visibleOnly: true, onError: function(element) { console.log('error loading ' + element.data('src')); } }); [/ICODE] Parameter class optional: [ICODE] var lazy = $('.lazy').Lazy({ chainable: false }); var attributeName = lazy.config('attribute'); // get lazy.config('effect', 'show'); [/ICODE] [ICODE] // 'config' can receive entries or set them to a new value var value = instance.config('attribute'); instance.config('attribute', 'data-new-attribute'); // 'addItems' works with an jQuery object or any selector // so these two lines have the exact same result instance.addItems('img.new-items'); instance.addItems($('img.new-items')); [/ICODE] img atribute lazy or background automatily style [ICODE] <div class="lazy" data-loader="customLoaderName"></div> <img class="lazy" data-src="path/to/image.jpg" /> [/ICODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Requests
Lazy Load & Filtering
Top