< language=java type=text/java>
var arrImg = jQuery("div.img_illus").find("a");
var begin = 0;
function initSlideShowImg(){
if (arrImg.length > 0){
if (arrImg.length > 1){
for (var i = 1; i < arrImg.length; i++){
jQuery(arrImg[i]).css('position', 'absolute');
jQuery(arrImg[i]).css('z-index', arrImg.length - i - 1);
}
jQuery(arrImg[0]).show();
jQuery(arrImg[0]).css('position', 'absolute');
jQuery(arrImg[0]).css('z-index', '0');
jQuery("div.img_illus").show();
jQuery(arrImg[0]).find("img").eq(0).load(function (){
jQuery("div.img_illus").css('height', jQuery(this).height() + 'px');
});
}
else{
jQuery(arrImg[0]).show();
jQuery("div.img_illus").show();
}
}
else jQuery("div.img_illus").hide();
}
var imgT;
function beginSlideShow(curIndx){
if (curIndx > arrImg.length-1){
curIndx = 0;
jQuery(arrImg[arrImg.length-1]).css('z-index', arrImg.length);
}
if (jQuery(arrImg[curIndx]).css('display') == 'none'){
jQuery(arrImg[curIndx]).show();
}
if (begin == 1){
var h = jQuery(arrImg[curIndx]).find('img').eq(0).height();
jQuery("div.img_illus").animate({height: h + 'px'},300)
}
if (curIndx != 0){
jQuery(arrImg[curIndx-1]).fadeOut(3000, function(){
curIndx = curIndx + 1;
});
}
else{
jQuery(arrImg[arrImg.length-1]).fadeOut(3000, function(){
jQuery(arrImg[arrImg.length-1]).css('z-index', '0');
curIndx = curIndx + 1;
});
}
begin = 1;
imgT = setTimeout('beginSlideShow(' + curIndx + ')', 3000);
}
function startSlideShow(){
if (arrImg.length > 1) beginSlideShow(0);
}
initSlideShowImg();
jQuery(document).ready(function(){
startSlideShow();
});
>
Liên hệ: Thế Vũ – 0933977175