background preloader


Facebook Twitter

GitHub - im4aLL/chromeSmoothScroll: Smooth scrolling for chrome browser. Responsive Sticky Sidebar. Edit fiddle. How to detect a click outside an element? Typekit/webfontloader: Web Font Loader gives you added control when using linked fonts via @font-face. Dynamically load google fonts after page has loaded. How to Improve Page Performance with a Font Loader. A big thanks to Jason Pamental for the inspiration to write this article. I’d never have considered the issue otherwise! When was the last time you used Arial, Times New Roman, Helvetica or … shudder … Comic Sans in your web pages? Web fonts took too long to arrive but, once they did, we never looked back. Fonts are fun, (often) free and fast to implement: @import url( You can then use the font throughout your pages, e.g.

The fonts also work in mobile devices so users get a great experience in your Responsive Web Design. Or do they? After images, fonts are the normally the largest assets in your web page. We rarely worry about font weight problems and make excuses such as “it’s only an issue on the first page” or “many users will have the font cached”. The JavaScript webfontloader Fortunately, there is another option: the webfontloader. CSS Callbacks JavaScript Callbacks Minimizing FOUT. Loading Web Fonts with the Web Font Loader. Several years ago the consensus on font loading in the community was that, as a website loads, all fonts should be hidden until the correct resources have been downloaded. Many designers and developers argued that the default font loading method called the “Flash of Unstyled Text”, or FOUT, was an annoyance to users.

This is when the fallback web font, say Georgia, is shown on screen first then replaced by a custom font when it loaded. They argued that it would make for a more cohesive browsing experience if users simply waited for everything to download instead of experiencing this flash from one typeface to another. But today this is not the case. In fact, this practice of letting a browser hide all the text that should be styled with a custom font is now called the ‘Flash of Invisible Text’, or FOIT, and is often regarded as the worst of all possible options.

Scott Jehl has argued that this is a pretty bad idea for both performance and usability: Flash of Invisible Text. Variables String JavaScript ¿Mejor usar comillas simples o dobles? Secuencias escape \n \t. length (CU01114E) Resumen: Entrega nº14 del curso "Tutorial básico del programador web: JavaScript desde cero". Codificación CU01114E A diferencia de otros lenguajes que diferencian un tipo de dato “carácter” (char) y otro cadena de texto (string), en JavaScript existe un único tipo para englobar tanto a caracteres como a cadenas de texto como a una cadena vacía: el tipo String. JavaScript permite definir el texto tanto dentro de comillas dobles como dentro de comillas simples. Por ejemplo es válido: var cadenaTexto; cadenaTexto = "" ; Y también es válido: cadenaTexto = '' ; HTML también permite usar comillas simples o dobles indistintamente.

Esto puede dar lugar a problemas. Onclick ="alert("Alerta JavaScript")" sería una construcción incorrecta porque el navegador no sabe interpretar qué comillas son de apertura y cuáles de cierre. Existen más caracteres de escape pero estos son los más usuales. Veamos un ejemplo. Detecting a "Touch Screen" Device Using Modernizr. I’m amazed at how the mobile phone evolved over the years. Today, mobile phones are touch-enabled, can be used to surf sites like on a desktop PC, and carry a lot of handy apps to help you be more productive.

When we build responsive websites that aim for mobile devices, sometimes we want to include specific and extra capabilities for users to make use of its multi-touch capability. Pin it But before that, we need to first identify if the device has support for touch interaction, and it is easy to do so with Modernizr. Check out: Getting Started with Modernizr Feature Detection with Modernizr At the Modernizr download page, ensure that the Touch Event option is selected.

You can then add this Modernizr.touch in your script. It’s a basic JavaScript that will show the following popup. Furthermore, you can also use this method to load touchSwipe, a jQuery plugin for touch gestures, conditionally. The above code will test for touch capability. Final Thought. On scroll animations using waypoints.js and animate.css - Did you ever wonder how the best themes implement on scroll animations? This tutorial will allow you to recreate the effect using the popular jquery-waypoints plugin as well as the animate.css library. On scroll animation is a technique which has gained popularity over the past several months. It suits one-page websites as well as websites with many illustrations perfectly, giving them a more dynamic appearance. However, the animations can be applied to any element as we will soon see. For this tutorial we assume the reader has some prior experience with javascript and more specifically with the jQuery library, as we will need the aid of the popular jQuery-waypoints plugin.

The following example will alert the user when he scrolls on any element that has a class ‘notify’: One can pass a second argument to the waypoint function, which is an options object. In the example above we express the offset as a percentage of the viewport’s height. But what if I want staggered animations? Edit fiddle. Edit fiddle. Edit fiddle. Jquery - Animate.css + Viewport Checker delay?