Archive

Archive for May, 2010

Preload images with jQuery

May 15th, 2010 No comments

Sometimes you might want to preload some images used in your site to improve user experience. In photo galleries or other image-heavy sites preloading images help visitor enjoy faster loading times.


jQuery can help us with a few lines of code to achieve that:

//Function that preloads a defined list of images (arguments for the function).
 jQuery.preloadImages = function(){
  //Loop through the images
  for(var i = 0; i<arguments.length; i++){
    jQuery("<img>").attr("src", arguments[i]);
  }
}

// Call the function:
$.preloadImages("images/1.png", "images/2.png", "images/3.png", "images/4.jpg");
Categories: Javascript, Web Design Tags:

Storing Data using jQuery

May 14th, 2010 No comments

A lot of developers tend to store additional data in HTML attributes which are not meant to store data. In order to solve this issue jQuery offers a data method with which you can store any data you might need.

Read more…

Categories: Javascript, Web Design Tags:

HTML 5 Presentation

May 3rd, 2010 No comments

Here is a great presentation about HTML 5 new features by apirocks.com.
You can view it by clicking here.

You have to use browsers that fully support HTML 5, like Chrome or Safari in order to take a look at all new features.

Categories: Web Design Tags: ,