Centering a Div Both Horizontally And Vertically

April 7, 2010

While building web page layouts, you’ve probably been faced with a situation where you need to center a div both horizontally and vertically with pure CSS. There are more than a few ways to achieve this, and in this article we are going to show you our favorite involving CSS and jQuery. But first, the basics: Horizontal centering with CSS .className{ margin:0 auto; width:200px; height:200px; } To center a div only horizontally, you need to specify a width, and an auto value for the left and right margins . This... [Read the full story]

Three ways to define a JavaScript class

April 3, 2010

Introduction JavaScript is a very flexible object-oriented language when it comes to syntax. In this article you can find three ways of defining and instantiating an object. Even if you have already picked your favorite way of doing it, it helps to know some alternatives in order to read other people’s code. It’s important to note that there are no classes in JavaScript. Functions can be used to somewhat simulate classes, but in general JavaScript is a class-less language. Everything is an object. And when it... [Read the full story]

Top 10 JavaScript Frameworks

November 14, 2009

JavaScript – an indispensable part for developing websites and web pages, whether that is simple pages or professional website, and whether you are senior or junior. Nowadays, JavaScript frameworks become more powerful and more specialized; they can do many things in just a few basic steps. However, when you decide that you need a JavaScript framework it can be quite a challenge to figure out which framework to should use, which framework is best for your needs? This is mainly because there are so many frameworks out there... [Read the full story]

Top 25 PHP template engines

January 30, 2009

After searching the Internet for a good template engine, I have compiled the following list: Smarty Smarty is a template engine that compiles the templates into PHP scripts, then executes those scripts. Very fast, very flexible. Heyes Template Class A very easy to use, yet powerful and quick template engine that enables you to separate your page layout and design from your code. FastTemplate A simple variable interpolation template class that parses your templates for variables and spits out HTML with their values ShellPage A... [Read the full story]

Finding Window Dimensions with Javascript

December 13, 2008

Sometimes you may want to find the dimensions of the user’s browser window. Below is a list of the propertiesthat are accessible with different browsers. Traditionally, window.innerWidth/window.innerHeight is the most widely accepted way to obtain these values, however, there is deviation between IE 4 and IE 6+ in “standards compliant mode.” Below, I have listed the different ways to find the window height and width. Non-IE Browsers window.innerWidth window.innerHeight IE 6+ in “standards compliant mode” document.documentElement.clientWidth document.docuementElement.clientHeight IE... [Read the full story]

Page 1 of 3123