WordPress.org

Ready to get started?Download WordPress

Forums

jQuery Image Lazy Load WP
Having trouble with images not loading? I found a solution! (3 posts)

  1. thomasfrank09
    Member
    Posted 2 years ago #

    After much hair-pulling and begging for help from my hardcore developer friends, I finally found a way to fix the problem with some images just failing to load at all when this plugin is active.

    Basically, the way I did it was to force the plugin to ignore images of a certain class. To do this, you need to make the jquery_lazy_load_ready function (located in the plugin's .php file) look like this:

    function jquery_lazy_load_ready() {
      $placeholdergif = plugins_url('images/grey.gif', __FILE__);
      echo <<<EOF
    <script type="text/javascript">
    jQuery(document).ready(function($){
      if (navigator.platform == "iPad") return;
      jQuery("img").not(".cycle img, .pariah").lazyload({
        effect:"fadeIn",
        placeholder: "$placeholdergif"
      });
    });

    The key component is this line: jQuery("img").not(".cycle img, .pariah").lazyload({

    See where is says .not(".cycle img, .pariah)? So all you have to do it add class="pariah" to the img tag of any image you want to exclude.

    Hope this helps someone just as frustrated as I was :)

    http://wordpress.org/extend/plugins/jquery-image-lazy-loading/

  2. evo252
    Member
    Posted 2 years ago #

    Thank you soooo much for having share your tip Thomas !!! You made my day ;)

  3. Revived
    Member
    Posted 2 years ago #

    Works for me. Thanks, brother! :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic