Minggu, 25 Maret 2012

Tips and Tricks Optimize jQuery Powerful For Developers

1) Use the Latest Version of jQuery

With all the innovation taking place in the jQuery project, one of the easiest ways to improve the performance of your web site is to simply use the latest version of jQuery. Every release of the library introduces optimizations and bug fixes, and most of the time upgrading involves only changing a script tag.
You can even include jQuery directly from Google’s servers, which provide free CDN hosting for a number of JavaScript libraries.
1<!-- Include a specific version of jQuery -->
3
4<!-- Include the latest version in the 1.6 branch -->
The latter example will include the latest 1.6.x version automatically as it becomes available, but as pointed out on css-tricks, it is cached only for an hour, so you better not use it in production environments.

2) Keep Selectors Simple

Up until recently, retrieving DOM elements with jQuery was a finely choreographed combination of parsing selector strings, JavaScript loops and inbuilt APIs like getElementById(), getElementsByTagName() and getElementsByClassName(). But now, all major browsers support querySelectorAll(), which understands CSS query selectors and brings a significant performance gain.
However, you should still try to optimize the way you retrieve elements. Not to mention that a lot of users still use older browsers that force jQuery into traversing the DOM tree, which is slow.
1$('li[data-selected="true"] a') // Fancy, but slow
2$('li.selected a'// Better
3$('#elem'// Best
Selecting by id is the fastest. If you need to select by class name, prefix it with a tag – $('li.selected'). These optimizations mainly affect older browsers and mobile devices.
Accessing the DOM will always be the slowest part of every JavaScript application, so minimizing it is beneficial. One of the ways to do this, is to cache the results that jQuery gives you. The variable you choose will hold a jQuery object, which you can access later in your script.

Free Flash Web Templates Guys.. Yeah..

1. The Ultimate Museum Site
flash web templates

2. The Boy Scout Green Template

flash web templates

3. The Gray Hotel Template

flash web templates

Amazing Beautiful of Macro Photography Part I

The trick is simple, you just reverse any normal camera lens), we are seeing a greater abundance of macro photography.
These photographers have managed to take insects (which I find particularly scary) and turn them into beautiful works of art. Each of these photos were hand picked for their ingenuity, unusualness and flair.
We can’t comprehend how much, as humans, we are limited to see. Take a look at the world around you and become amazed at the small details we often miss.