Learn how to use jQuery at the Blog

liteFlick « visit

  • Added 10 months ago
  • 23 Lines of Code shown
  • 1 Links of Interest
http://liteflick.com
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to liteFlick - http://liteflick.com

			// loop through images
			$(images).each(function(index,value){
					// create the LI programatically
					var list = $('<li id="portfolio_'+index+'"></li>').attr('class','loading').html(info[index]);
					// append the new LI to UL
					$('ul#portfolio').append(list);
					// current LI object
					var curr = $("ul#portfolio li#portfolio_"+index);
					// new image
			    var img = new Image();
					// load image
	        $(img).load(function () {
	            $(this).css('display','none'); // since .hide() failed in safari
	            $(curr).removeClass('loading').children().append(this);
	            $(this).fadeIn(); //.show(); //.fadeIn();
	      
	        }).error(function () {
						$(curr).remove();
	        }).attr('src', value);
			});			
			

$("a.lightbox-enabled").lightBox();