Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
lazy load, load your page faster & save bandwidth Details »»
lazy load, load your page faster & save bandwidth
Version: 1.00, by dinodonk dinodonk is offline
Developer Last Online: Oct 2015 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.1.0 Rating:
Released: 02-22-2011 Last Update: Never Installs: 117
Template Edits
Re-useable Code Additional Files  
No support by the author.

this mod is using jquery lazy load by Mika Tuupola. you can see demo at his site here

Lazy Load will delay the loading of images outside of viewpoint to make the page load faster. That is, images in the visible part of the web page are only loaded and remaining images are loaded when visitor scrolls down the page, at some times it can even helps to save bandwidth.

in template headinclude, add this code at the bottom

Code:
  
<vb:if condition="THIS_SCRIPT == 'showthread'">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>  
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/jquery.lazyload.mini.js"></script>
  <script type="text/javascript" charset="utf-8">
      $(function() {
          $(".postbody img").lazyload({placeholder : "{vb:raw vboptions.bburl}/clear.gif", effect: "fadeIn"});
      });
  </script>
</vb:if>
copy jquery.lazyload.mini.js to your <vb root>/clientscript/ folder


done!!!

pls click install if you like this modification


Thanks to OldSchoolDSL for this suggestion

Download Now

File Type: zip jquery.lazyload.mini.zip (948 Bytes, 784 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
caoanh204, nacaruncr

Comments
  #22  
Old 04-16-2012, 06:10 PM
Kolbi Kolbi is offline
 
Join Date: Mar 2009
Location: D - S?dbaden
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any SEO disadvantages?
Reply With Quote
  #23  
Old 05-18-2012, 12:36 AM
scdurwood scdurwood is offline
 
Join Date: Aug 2006
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

having an issue with loading the page on the first unread post....jumps to the end of the thread...
Reply With Quote
  #24  
Old 01-11-2013, 08:49 AM
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Location: Earth
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use below code supports almost all vbulletin 3.x.x , 4.x.x

Add the code in headinclude Template

Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://www.megawrz.com/clientscript/jquery.lazyload.js?v=3"></script>
    <script type="text/javascript">
      $(function(){
        $('img[original-src]').lazyload({threshold: 100});
      });
    </script>
<noscript>
      <style>
        img[original-src]{display: none;}
      </style>
    </noscript>
TESTED Almost 100 HD Mobile Images Loads less than 3 sec in 512kb internet speed
DEMO HERE
Reply With Quote
  #25  
Old 01-12-2013, 06:58 PM
993ti 993ti is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ramesh_umk3 View Post
Use below code supports almost all vbulletin 3.x.x , 4.x.x

Add the code in headinclude Template

Code:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://www.megawrz.com/clientscript/jquery.lazyload.js?v=3"></script>
    <script type="text/javascript">
      $(function(){
        $('img[original-src]').lazyload({threshold: 100});
      });
    </script>
<noscript>
      <style>
        img[original-src]{display: none;}
      </style>
    </noscript>
TESTED Almost 100 HD Mobile Images Loads less than 3 sec in 512kb internet speed
DEMO HERE
But without www .megawrz .com.....
Reply With Quote
  #26  
Old 01-13-2013, 05:22 AM
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Location: Earth
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Save .js file and keep in your root folder, nothing gonna happen even you use as it is...
Reply With Quote
  #27  
Old 01-13-2013, 09:26 PM
YOODA230 YOODA230 is offline
 
Join Date: Jun 2011
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

4.2.3 WORKS GREAT
Reply With Quote
  #28  
Old 07-03-2013, 08:51 PM
Azum Azum is offline
 
Join Date: Jun 2013
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone get this to work? Tried the original code and the code by ramesh_umk3 with the updated .js files. Just doesn't seem to do anything in vbulletin.
Reply With Quote
  #29  
Old 07-04-2013, 09:56 AM
inigo inigo is offline
 
Join Date: May 2010
Location: Spain
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this mod work on CMS?
Reply With Quote
  #30  
Old 07-04-2013, 03:45 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it doesn't work then you can do the same thing with google pagespeed service or mod pagespeed.



Quote:
Lazyload Images

Objective

Optimize browser rendering and reduce number of HTTP round-trips by deferring the loading of images which are not in the client's viewport. This rewriter implements the PageSpeed rules for optimizing browser rendering and minimizing round trip times.

Description

The Lazyload Images rewriter defers loading of images until they are visible in the client's viewport. It changes the src attributes of <img> elements on each HTML page to pagespeed_lazy_src. It attaches an onload handler to these elements to determine whether the element is in the client's viewport, and if so, loads it.

For images that are below the fold, this rewriter has two modes of operation:

On page load: Images below the fold are loaded after the onload event is fired. This is done by attaching an event to the onload handler of the page that loads all images that haven't already been loaded.
On scroll: Images below the fold are loaded when they become visible in the client's viewport as the user scrolls down the page. This is done by attaching an event to the onscroll handler of the page that loads newly visible images.
Lazyload Images doesn't defer an img tag if it has the pagespeed_no_defer attribute. Usage:

<img pagespeed_no_defer="" src=.../>
Example

The effect of this rewriter can be observed by comparing the number of requests before and after rewriting. As you scroll down, you will notice that images below the fold are only requested after they become visible in the viewport.

Risks

The computation of each image's position in the viewport may consume additional CPU cycles on the client side. Sites that employ JavaScript libraries to implement lazy-loading may not work properly with this mechanism.
Quote:
Originally Posted by Azum View Post
Anyone get this to work? Tried the original code and the code by ramesh_umk3 with the updated .js files. Just doesn't seem to do anything in vbulletin.
Reply With Quote
  #31  
Old 09-23-2013, 01:15 PM
Bisha's Avatar
Bisha Bisha is offline
 
Join Date: Mar 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with current jQuery version?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08495 seconds
  • Memory Usage 2,336KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete