Changeset 90351 in spip-zone


Ignore:
Timestamp:
Jun 19, 2015, 7:14:49 AM (4 years ago)
Author:
arno@…
Message:

Passer la détection du scroll en requestAnimationFrame, avec polyfill rAF.js.

Location:
_plugins_/image_responsive
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/image_responsive/image_responsive_fonctions.php

    r90040 r90351  
    1717        $flux .= "<script>htactif=$htactif;document.createElement('picture');</script>";
    1818        $flux .= "
     19<script type='text/javascript' src='".find_in_path("javascript/rAF.js")."'></script>
    1920<script type='text/javascript' src='".find_in_path("javascript/jquery.smartresize.js")."'></script>
    2021<script type='text/javascript' src='".find_in_path("javascript/image_responsive.js")."'></script>
     
    3031
    3132        $flux .= "
     33<script type='text/javascript' src='".find_in_path("javascript/rAF.js")."'></script>
    3234<script type='text/javascript' src='".find_in_path("javascript/jquery.smartresize.js")."'></script>
    3335<script type='text/javascript' src='".find_in_path("javascript/image_responsive.js")."'></script>
  • _plugins_/image_responsive/javascript/image_responsive.js

    r89817 r90351  
    269269        didScroll_image_responsive = true;
    270270}
    271 setInterval(function() {
     271
     272function render_image_responsive() {
    272273    if(didScroll_image_responsive) {
    273274                didScroll_image_responsive = false;
    274275                _charger_image_responsive()
    275276    }
    276 }, 100);
    277 
     277}
     278
     279(function animloop_image_responsive(){
     280  requestAnimationFrame(animloop_image_responsive);
     281  render_image_responsive();
     282})();
     283
     284
     285
  • _plugins_/image_responsive/paquet.xml

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