background preloader

QuirksMode - for all your browser quirks

QuirksMode - for all your browser quirks
Related:  JavaScriptfront-end

La fusion des marges en CSS Qu’est-ce que la fusion des marges? La fusion des marges est un mécanisme décrit dans la spécification CSS (CSS 2.1: Collapsing Margins). Il concerne les marges verticales (margin-top et margin-bottom) des éléments de type bloc. C’est un mécanisme qui, pour deux blocs qui se suivent, «fusionne» la marge inférieure du premier et la marge supérieure du deuxième. <p style="margin-bottom: 20px;"> Premier paragraphe </p><p style="margin-top: 30px;"> Deuxième paragraphe </p> Pourquoi ce mécanisme? La fusion des marges est très utile pour obtenir des espaces harmonieux entre les portions de texte. la marge supérieure correspond au retrait minimal souhaité avant l’élément; la marge inférieure correspond au retrait minimal souhaité après l’élément. Voici par exemple un code CSS simple qui exploite ce mécanisme, pour obtenir des espaces harmonieux entre les paragraphes: Fusion des marges entre un élément et son parent Exemple simple de fusion des marges enfant—parent Nous obtenons le résultat suivant:

3.0 and jQuery Compat 3.0 Alpha Versions Released It’s been a long time since we did a major release, and you certainly deserve one. So we’re glad to announce the first alpha of jQuery 3.0! Despite the 3.0 version number, we anticipate that these releases shouldn’t be too much trouble when it comes to upgrading existing code. There are actually two releases here. You can also get the alpha versions from npm: npm install jquery@3.0.0-alpha1 npm install jquery-compat@3.0.0-alpha1 Major changes Below are just the highlights of the major new features, improvements, and bug fixes in these releases. Simplified .show() and .hide() methods Everyone’s mental model of jQuery’s .hide() method is that it sets display: none in CSS. Well, no. Since these methods add a style attribute to the element, they don’t tend to play well with techniques like responsive design where the visibility of elements may also be set by media queries. .unwrap( selector ) Thanks

« Hannu's Plaza » Doing gravity right Now you may be thinking: "baah, I know how to do gravity.." but there's a big flaw in the commonly used Euler's method to handle the gravity (or other forces). Even all the Quake games have this problem. Then what is it? If you have more frames per second in Quake, your player will run faster and jump higher. There are some places in Quake where you can't jump high enough if you don't have enough frames per second. Most of the programmers do the gravity something like this: velocity = velocity + gravity*delta_time position = position + velocity*delta_time The algorithm above is ok but when delta_time changes or delta_time is too high, it causes many unwanted problems. velocity = velocity + gravity*delta_time/2 position = position + velocity*delta_time velocity = velocity + gravity*delta_time/2 That's it.. but you need proof, right? But what the bad algorithm actually does is shown in the picture on right. Here is how the new algorithm handles the integration: Results in practice

JQuery Cycle Plugin Check out Cycle2, the latest in the Cycle line of slideshows. The jQuery Cycle Plugin is a slideshow plugin that supports many different types of transition effects. It supports pause-on-hover, auto-stop, auto-fit, before/after callbacks, click triggers and much more. It also supports, but does not require, the Easing Plugin. The plugin provides a method called cycle which is invoked on a container element. Images are used in these demos because they look cool, but slideshows are not limited to images. Use the Effects Browser page to preview the available effects. For more about options, see the Options Reference page. Frequently Asked Questions Special thanks to Torsten Baldes, Matt Oakes, and Ben Sterling for the many ideas that got me started on writing Cycle in 2007.

Display inline-block, une valeur trop peu utilisée Floatera, floatera pas… mais pourquoi ne pas utiliser la valeur inline-block de la propriété display en CSS ? Vous connaissez certainement les valeurs block ou inline, mais moins celle de inline-block et pourtant elle peut vous servir dans bien des cas. Voyons dans quelles conditions nous pouvons l'utiliser (de manière non exhaustive) dans un premier temps, puis dans un second temps quelques difficultés dans son utilisation. Cette astuce a été publiée initialement sur le blog personnel de l'auteur, à la date du Jeudi 17 mars 2011. Utiliser display: inline-block Par défaut les éléments input ont comme valeur de display celle de inline-block. Le formulaire Quelle transition ! Je vous propose cette forme de mise en page pour formulaire. Notre code CSS va donc nous permettre d'avoir un comportement homogène. La CSS : Aperçu du formulaire Une navigation horizontale (éléments de liste) Le code HTML : Le code CSS : Remarque : la valeur inline sur le li est suffisante dans mon exemple.

JavaScript reference This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference. Global objects This chapter documents all the JavaScript standard built-in objects, along with their methods and properties. Statements This chapter documents all the JavaScript statements and declarations. For an alphabetical listing see the sidebar on the left. Control flow Block A block statement is used to group zero or more statements. break Terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement. continue Terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. Empty An empty statement is used to provide no statement, although the JavaScript syntax would expect one. if...else Executes a statement if a specified condition is true. switch throw Throws a user-defined exception. var let in

Semantic Versioning 2.0.0-rc.2 80+ AJAX-Solutions For Professional Coding | Developer&#039;s Toolbox Advertisement Web-developers can create amazing web-applications with AJAX. Stikkit1, Netvibes2, GMail3 and dozens of further web-projects offer a new level of interactivity we’ve used to give up the idea of. Modern web-applications can be designed with enhanced user interfaces and functionalities, which used to be the privelege of professional desktop-applications. AJAX makes it possible to create more interactive, more responsive and more flexible web-solutions. And it’s the first step towards rich internet applications of the future. Asynchronous JavaScript and XML isn’t a new programming language, as it is often mistakingly called. In this article we’d like to present a list of over 90 useful AJAX-based techniques you should always have ready to hand developing AJAX-based web-applications. You may also want to take a look at the article 60 More Ajax and Javascript Solutions For Professional Coding9. AJAX Auto Completer 1. 2. 3. 4. 5. AJAX Instant Edit 6. 7. 8. AJAX Menus, Tabs 10. 11.

25 Useful CSS3 Techniques and Tutorials Learn how to earn $125 or more per hour as a freelancer - Click Here Looking for hosting?. We recommend MediaTemple for web hosting. Use Code MTLOVESDESIGN for 20% off Css3 have a capacity to revolutionize the way we design/develop website. css3 is intoducing loads of new and exciting features. It is essential today for a web designer to know about CSS3 and there are many tutorials and resources for the CSS3. 1.) We will create a dynamic stack of index cards solely with HTML and CSS3 and use such CSS3 features as transform and transition (for the dynamic effects) and @font-face, box-shadow and border-radius (for the styling). 2.) Analogue clock created using webkit transition and transform CSS. 3.) The trick with these overlays is the gradient border, going form a lighter to darker orange as you go from top to bottom. 4.) What if we could replace almost all of the graphical UI elements within Fennec with CSS created equivalents? 5.) 6.) 7.) 8.) 9.) 10.) 11.) 12.) 13.) 14.) 15.) 17.)