转载请自觉注明原文:http://jq-show.com/Detail.aspx?id=183
更多最新分享的插件请访问:http:www.jq-show.com
首先非常感谢网友林林的无私分享,此Jquery特效是一款非常实用韩国风随机播放焦点广告,增强用户体验效果,非常酷,实用功能的代码也非常简单,网友们好好看一下哦。
功能代码如下:
var roll_image = new Array;
var image_link = new Array;
var small_img = new Array;
roll_image[0] = 'images/01.jpg';
small_img[0] = 'images/main_flash_button1_on.gif';
roll_image[1] = 'images/02.jpg';
small_img[1] = 'images/main_flash_button2_on.gif';
roll_image[2] = 'images/03.jpg';
small_img[2] = 'images/main_flash_button3_on.gif';
roll_image[3] = 'images/04.jpg';
small_img[3] = 'images/main_flash_button4_on.gif';
roll_image[4] = 'images/05.jpg';
small_img[4] = 'images/main_flash_button5_on.gif';
roll_image[5] = 'images/06.jpg';
small_img[5] = 'images/main_flash_button6_on.gif';
roll_image[6] = 'images/07.jpg';
small_img[6] = 'images/main_flash_button7_on.gif';
var cliImg = '';
var cliImgSrc = '';
var imgNo = Math.round(Math.random() * 7);
var interval = 3000;
var setTime = '';
function click_simg(ci, no){
var pImg = document.all.bigimg;
var pLink = document.all.imglink;
if(cliImg == '') {
cliImg = ci;
cliImgSrc = ci.src;
ci.src = small_img[no];
imgNo=no;
pImg.src =roll_image[no];
pLink.href = image_link[no];
} else if(cliImg != ci) {
cliImg.src = cliImgSrc;
cliImg = ci;
cliImgSrc = ci.src;
ci.src = small_img[no];
imgNo=no;
pImg.src =roll_image[no];
pLink.href = image_link[no];
}
clearTimeout(setTime);
setTime=setTimeout("rotate()",interval);
}
function rotate(){
imgNo = (imgNo >= 6) ? 0 : imgNo 1;
var ci = eval('document.all.num_img' imgNo);
document.all.bigimg.filters.blendTrans.apply();
document.all.imglink.href=image_link[imgNo];
document.all.bigimg.src=roll_image[imgNo];
document.all.bigimg.filters.blendTrans.play();
if(cliImg == '') {
cliImg = ci;
cliImgSrc = ci.src;
ci.src = small_img[imgNo];
} else if(cliImg != ci) {
cliImg.src = cliImgSrc;
cliImg = ci;
cliImgSrc = ci.src;
ci.src = small_img[imgNo];
}
setTime=setTimeout("rotate()",interval);
}
//-->