The web changes every day. New technologies and techniques emerge and others disappear. For this reason, web designers and front-end developers have to be familiar with many of the latest web design trends. Parallax scrolling, fixed headers, flat design, one-page websites, and animations are some of the hottest current web trends.
In this tutorial, we’ll take a look at scroll-based animations and effects using CSS and jQuery.
The four effects that we’ll be creating can be viewed in this demo. But before we get to the effects, let’s have a brief intro.
Note: The code used in this tutorial could be improved with object caching and the use of CSS animations instead of jQuery's `animate()` method, but for simplicity, we've repeated object declarations and we've kept everything inside jQuery to keep things focused on the concepts.
Scroll-based animations and effects are a new, yet well-known technique that gives front-end developers the ability to create rich and interactive web experiences. They’re fired when a user scrolls down a page and they can be easily manipulated and implemented with CSS and jQuery.
In order to detect whether a user is scrolling down the page, we use jQuery’s scroll() event.
Once we know that the user is scrolling, we can get the vertical position of the window’s scrollbar using jQuery’s scrollTop() method and apply the desired effects:
[code language="javascript"] $(window).scroll(function() { if ($(this).scrollTop() > 0) { // apply effects and animations } }); [/code]If we’re interested in creating responsive scroll-based effects, we have to define the following properties:
width
property.height
property.Without these properties defined, we create scroll-based effects that are “static” and will not work correctly when the user resizes the window’s either horizontally or vertically.
We can easily retrieve the values of these properties using jQuery’s width() and height() methods.
Continue reading %An Introduction to jQuery Scroll-based Animations%
Microsoft a décidé de fêter les 20 ans de son site web en republiant la version d'origine. Séquence nostalgie.
Avant de commencer cet article, signalons que notre ami framasoftien Cyrille a gentiment ajouté de nouveaux dessins du Geektionnerd à GéGé, le Générateur de Geektionnerd !
Sources sur Numerama :
Crédit : Simon Gee Giraudot (Creative Commons By-Sa)
Vous utilisez Spotify ? Si oui, connaissiez-vous ces 5 astuces qui vous permettront d'utiliser pleinement les fonctionnalités proposées par cet outil ?
WhoHasAccess, une application web qui vous permet de gérer plus aisément les accès à vos documents sur Google Drive.
Les statistiques de Flurry indiquent que le public féminin passe plus de temps et fait plus d’achats sur les jeux sur mobile.
Connaissez-vous ces 10 raccourcis qui vous permettent de gagner un temps considérable dans Gmail ?
Rendez-vous avec Anne-Isabelle Dauça (CEO) pour découvrir et parler du projet Padoo au travers d’une interview. Voici l’échange retranscrit que nous avons eu : J’ai eu diverses expériences dans des […]
L'article Padoo : Etiquette pour retrouver ses objets perdus est la propriété de Baptiste sur WebLife - Actualités internet, high-tech & startups.
Dimanche dernier, je vous parlais de Synolocker, une variante du cheval de Troie Cryptolocker qui a la particularité de chiffrer les NAS Synology et d'inciter les victimes à payer pour récupérer leurs fichiers. Pas cool. Mais voici une excellente nouvelle pour toutes les victimes de la version Windows de CryptoLocker. Les sociétés FireEye et Fox-IT […]
Cet article merveilleux et sans aucun égal intitulé : CryptoLocker – Si vous avez été infecté, voici comment déchiffrer vos fichiers ; a été publié sur Korben, le seul site qui t'aime plus fort que tes parents.
Le droit de séjour de Snowden en Russie est étendu de trois années supplémentaires.
Si je vous demande de mettre une vidéo en ligne rapidement, vous allez me proposer plusieurs solutions. Mais globalement, ce sera : Fous là sur un FTP et mets un bout de code HTML5 pour avoir le player sur une page Balance là sur YouTube (ou service similaire) Et si je vous disais que vous […]
Cet article merveilleux et sans aucun égal intitulé : MediaGoblin – Hébergez votre propre clone de Youtube ; a été publié sur Korben, le seul site qui t'aime plus fort que tes parents.
Rendez-vous avec Mehdi Amour (Co-Fondateur) pour découvrir et parler du projet CompareAgences au travers d’une interview. Voici l’échange retranscrit que nous avons eu : Très rapidement, je suis Mehdi Amour, […]
L'article CompareAgences : Identifier l’agence immobilière fiable et performante est la propriété de Baptiste sur WebLife - Actualités internet, high-tech & startups.
Facebook aurait déjà discuté avec des dirigeants d’Hollywood à propos de contenus destinés aux casques Oculus.
Line25 Sites of the Week is a weekly roundup of the most outstanding website designs that I stumble across during my every day browsing. In this week’s collection, we have designs from Kaber Technologies, Made by Friends, Uppercase, Jorge Almeida and Benchmark. Kaber Technologies View the website Drones · A Data Narrative Made by Friends […]
The post Line25 Sites of the Week for August 8th 2014 appeared first on Line25.