Shaare your links…
407 links
Liens · Devenet Home Login RSS feed Tags cloud
11 results for tags javascript x
  • Comment formater les nombres en Javascript → https://blog.shevarezo.fr/post/2023/02/01/javascript-comment-internationaliser-nombres
    new Intl.NumberFormat(navigator.language).format(123456.78);
    123456.78.toLocaleString();
    Tue Feb 7 10:58:27 2023 – #permalink
    i18n javascript
  • JavaScript : Prévisualiser une image avant l'upload → https://www.akilischool.com/cours/javascript-previsualiser-une-image-avant-lupload
    Mon Jul 12 14:14:36 2021 – #permalink
    javascript
  • In Praise of the Unambiguous Click Menu → https://css-tricks.com/in-praise-of-the-unambiguous-click-menu/
    “Hover menus are inconsistent.“
    Exemple de menu cliquable.
    Fri Apr 2 16:06:26 2021 – #permalink
    css javascript js
  • Stop setting the language of your website based on user location → https://dev.to/bitdweller/stop-setting-the-language-of-your-website-based-on-my-location-31h0
    Il est plus judicieux de se baser sur les langues acceptées par le navigateur de l'utilisateur que sa position pour déterminer sa langue…

    En JavaScript, c'est facile :
    > var userLang = navigator.language || navigator.userLanguage;
    Tue May 19 15:44:26 2020 – #permalink
    i18n javascript
  • An alternative to if/else and switch in JavaScript - Waxo → http://blog.wax-o.com/2015/05/an-alternative-to-if-else-and-switch-in-javascript/
    Comment éviter un switch ou un if/else en javascript : avec un tableau :)

    let values = {
       a: 1,
       b: 2,
    };
    let foo = values[ bar ] || 3;

    est équivalent à

    let foo = '';
    if ( bar === 'a' )
       foo = 1;
    else if ( bar === 'b' )
       foo = 2;
    else
       foo = 3;
    Thu Apr 28 16:04:19 2016 – #permalink
    javascript
  • [JavaScript] detect down/up scrolling - Le Hollandais Volant → http://lehollandaisvolant.net/?mode=links
    // Initial state
    var scrollPos = 0;
    // adding scroll event
    window.addEventListener('scroll', function(){ scrolling() });

    // the function : compares the "new" scrolling state with the previous
    // (this allows detecting either "up" or "down" scrolling)
    // then saves the new in the $previous for the next iteration.

    function scrolling() {
    if ((document.body.getBoundingClientRect()).top > scrollPos) {
    console.log('scrolling DOWN');
    } else {
    console.log('scrolling UP');
    }
    scrollPos = (document.body.getBoundingClientRect()).top;
    }
    Wed Feb 24 23:07:05 2016 – #permalink
    javascript
  • Superpower your JavaScript with 10 quick tips → http://www.htmlxprs.com/post/14/superpower-your-javascript-with-10-quick-tips
    for (var i=0,length=array.length;i<length;i++){
    //awesome code goes here
    }
    Wed Oct 1 14:15:30 2014 – #permalink
    astuce développement javascript web
  • [Tuto] Comprendre et utiliser les évènements clavier en Javascript - Yosko.net → http://www.yosko.net/article33/snippet-06-javascript-capturer-des-raccourcis-clavier-utilises-par-votre-navigateur
    Je me mets ça sous le coude.
    Déjà lu des choses, mais c'est pour pas oublier d'ajouter la navigation par touches dans AdventCalendar.
    Wed Apr 23 15:43:57 2014 – #permalink
    développement javascript
  • 7 lines JavaScript library for calling asynchronous functions → http://krasimirtsonev.com/blog/article/7-lines-JavaScript-library-for-calling-asynchronous-functions
    M'ouais sinon y'a http://stackoverflow.com/questions/899102/how-do-i-store-javascript-functions-in-a-queue-for-them-to-be-executed-eventuall

    // Function wrapping code.
    // fn - reference to function.
    // context - what you want "this" to be.
    // params - array of parameters to pass to function.
    var wrapFunction = function(fn, context, params) {
       return function() {
           fn.apply(context, params);
       };
    }


    // Create my function to be wrapped
    var sayStuff = function(str) {
       alert(str);
    }

    // Wrap the function.  Make sure that the params are an array.
    var fun1 = wrapFunction(sayStuff, this, ["Hello, world!"]);
    var fun2 = wrapFunction(sayStuff, this, ["Goodbye, cruel world!"]);

    // Create an array and append your functions to them
    var funqueue = [];
    funqueue.push(fun1);
    funqueue.push(fun2);

    // Remove and execute all items in the array
    while (funqueue.length > 0) {
       (funqueue.shift())();  
    }
    Mon Apr 7 22:29:54 2014 – #permalink
    javascript ressource
  • Keypress: A Javascript library for capturing input → http://dmauro.github.io/Keypress/
    Une petite librairie JavaScript (apparemment sans dépendance apparament) pour écouter les touches tapées sur le clavier d'un internaute dans une page Web. Ça a l'air intéressant et très pratique, et plus c'est sur github :)
    Tue Oct 1 17:44:27 2013 – #permalink
    développement javascript ressource
  • The algorithm for a perfectly balanced photo gallery → http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
    Un alogrithme en JavaScript pour générer une page remplie d'images, même si elles ont des tailles ou ratios différents.
    Exemple : http://www.chromatic.io/FQrLQsb

    (via http://sebsauvage.net/links/?BZI9-Q)
    Mon Aug 12 14:31:56 2013 – #permalink
    javascript
Shaarli by sebsauvage
Shaarli-Theme by Nicolas based on idleman theme