Changeset 80595 in spip-zone


Ignore:
Timestamp:
Feb 9, 2014, 8:54:22 PM (6 years ago)
Author:
arno@…
Message:

Bug: le lazyload ne fonctionnait pas correctement (arg).

Location:
_plugins_/image_responsive
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/image_responsive/image_responsive.js

    r80570 r80595  
    7777}
    7878
    79 function charger_image_lazy(top) {
    80         if (!top) var top = $(window).scrollTop();
    81         var height = $(window).height();
     79function charger_image_lazy(sTop) {
     80        if (typeof(sTop) == 'undefined') var sTop = $(window).scrollTop();
     81        var hauteur = $(window).height();
    8282       
    83         var limite_haut = top - height;
     83        var limite_haut = sTop - hauteur;
    8484        if (limite_haut < 0) limite_haut = 0;
    8585       
    86         var limite_bas = top + 1.5*height;
     86        var limite_bas = sTop + 1.5*hauteur;
    8787
     88       
     89
     90                console.log(sTop);
    8891
    8992        $(".lazy[data-top]").each(function() {
    9093                this_img = $(this);
    9194                var h = this_img.attr("data-top");
     95               
     96               
    9297                if (h <= limite_bas && h >= limite_haut) charger_url_image_responsive(this_img);
    9398        });     
     
    121126        timeout_charger_image_responsive = setTimeout("charger_image_responsive()",200);
    122127});
    123 $(window).on("scroll touchmove", charger_image_lazy);
     128$(window).on("scroll touchmove", function() {
     129        charger_image_lazy();
     130        });
  • _plugins_/image_responsive/paquet.xml

    r80570 r80595  
    22        prefix="image_responsive"
    33        categorie="outil"
    4         version="1.5.0"
     4        version="1.5.5"
    55        etat="stable"
    66        compatibilite="[3.0.0;3.1.*]"
Note: See TracChangeset for help on using the changeset viewer.