[spolier]
// DOM Ready
$(function () {
// Image Sources
var images = new Array();
images[0]='http://static3.mangastream.com/manga/1/94/00a.jpg';
images[1]='http://static3.mangastream.com/manga/1/94/00b.jpg';
images[2]='http://static3.mangastream.com/manga/1/94/01.jpg';
images[3]='http://static3.mangastream.com/manga/1/94/02_03.jpg';
images[4]='http://static3.mangastream.com/manga/1/94/04.png';
images[5]='http://static3.mangastream.com/manga/1/94/05.png';
images[6]='http://static3.mangastream.com/manga/1/94/06.png';
images[7]='http://static3.mangastream.com/manga/1/94/07.png';
images[8]='http://static3.mangastream.com/manga/1/94/08.png';
images[9]='http://static3.mangastream.com/manga/1/94/09.png';
images[10]='http://static3.mangastream.com/manga/1/94/10.png';
images[11]='http://static3.mangastream.com/manga/1/94/11.png';
images[12]='http://static3.mangastream.com/manga/1/94/12.png';
images[13]='http://static3.mangastream.com/manga/1/94/14.png';
images[14]='http://mangastream.com/static/images/rss_icon.gif';
images[15]='http://static3.mangastream.com/manga/1/94/15.png';
images[16]='http://static3.mangastream.com/manga/1/94/16.png';
images[17]='http://static3.mangastream.com/manga/1/94/17.png';
images[18]='http://static3.mangastream.com/manga/1/94/17.png';
images[19]='http://static3.mangastream.com/manga/1/94/18.png';
images[20]='http://static3.mangastream.com/manga/1/94/19-20.png';
// -----------------------------Loading image automatically---------------------------------
//loop through images
$(images).each(function(index,value){
// create the LI programatically
var list = $('<li id="portfolio_'+index+'"></li>').html('
');
// append the new LI to UL
$('ul#portfolio').append(list);
// current LI object
var curr = $("ul#portfolio li#portfolio_"+index);
// new image object
var img = new Image();
// load image
$(img).load(function () {
$(this).css('display','none'); // since .hide() failed in safari
$(this).addClass('m_picture');
$(curr).html('').append(this);
$(this).fadeIn();
}).error(function () {
// error handling remove current element
$(curr).remove();
}).attr('src', value);
});
// -----------------------------End of Loading image automatically---------------------------------
});
[/spolier]