Changeset 79197 in spip-zone


Ignore:
Timestamp:
Dec 6, 2013, 1:10:10 PM (7 years ago)
Author:
arno@…
Message:

Pouvoir forcer la valeur du "scrollTop" de la fonction charger_image_lazy. Ce qui permet de rendre le plugin compatible avec skroller (qui intercepte le scrollTop sur mobile), en déclenchant le skrollr ainsi:

var sk = skrollr.init({

render: function(data) {

charger_image_lazy(data.curTop);

}

});

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/image_responsive/image_responsive.js

    r78833 r79197  
    4343}
    4444
    45 function charger_image_lazy() {
    46         var top = $(window).scrollTop();
     45function charger_image_lazy(top) {
     46        if (!top) var top = $(window).scrollTop();
    4747        var height = $(window).height();
    4848       
     
    6161
    6262function charger_image_responsive () {
    63 
    6463        // Premier passage: mettre les images inconnues au bon format
    6564        $("img[src$='rien.gif']").each(function() {
Note: See TracChangeset for help on using the changeset viewer.