📄 my.js
字号:
// JavaScript Document
/*============ main pic-switcher =======================*/
var imgWidth=410; //图片宽
var imgHeight=235; //图片高
var TimeOut=5000; //每张图切换时间 (单位毫秒);
var imgAlt=new Array();
var imgUrl=new Array();
var imgLink=new Array();
var imgStyle=''; //图片style (注: 不是class)
var focustextStyle='height:25px; line-height:25px; text-align:center;'; //焦点文字style (注: 不是class)
imgUrl[0]='Skin/Beautiful/Images/main/01.jpg';
imgLink[0]='http://www.jisushop.com';
imgAlt[0]='容颜首页';
imgUrl[1]='Skin/Beautiful/Images/main/02.jpg';
imgLink[1]='http://www.jisushop.com';
imgAlt[1]='服饰首页';
imgUrl[2]='Skin/Beautiful/Images/main/03.jpg';
imgLink[2]='http://www.jisushop.com';
imgAlt[2]='《塑身》首页';
imgUrl[3]='Skin/Beautiful/Images/main/04.jpg';
imgLink[3]='http://www.jisushop.com';
imgAlt[3]='情感两性首页';
imgUrl[4]='Skin/Beautiful/Images/main/05.jpg';
imgLink[4]='http://www.jisushop.com';
imgAlt[4]='居家首页';
var count=0;
for (i=0;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgAlt[i]!="")&(imgUrl[i]!=null) && (imgLink[i]!=null)&&(imgAlt[i]!=null) ) {
count++;
} else {
break;
}
}
function change(i){
window.clearInterval(theTimer);
switch(browser){
//ie6 以上版本
case 1 :
adNum = i; nextAd_1();
break;
//其他浏览器
case 2 :
adNum = i-1; nextAd_2();
break;
}
}
/* nextAd_1 */
function nextAd_1() {
if(bStart == 0)
{
bStart = 1;
theTimer=setTimeout('nextAd_1()', 1000);
return;
}
else
{
oTransContainer.filters[0].Apply();
for (var i=0;i<count;i++){
//document.getElementById('b'+i).className = button_off;
document.images['oDIV'+i].style.display = "none";
}
//document.getElementById('b'+adNum).className = button_on;
document.images['oDIV'+adNum].style.display = "block";
document.getElementById('f_link').href=imgLink[adNum];
document.getElementById('blank_pic').alt=imgAlt[adNum];
//document.getElementById('focustext').innerHTML=imgtext[adNum];
oTransContainer.filters[0].Play(duration=2);
if(adNum == 4)
adNum = 0;
else
adNum++;
}
theTimer=setTimeout("nextAd_1()", TimeOut);
}
/* nextAd_2 */
function nextAd_2(){
if(adNum < count) adNum++;
else adNum = 0;
document.images.imgInit.src=imgUrl[adNum];
document.getElementById('f_link').href=imgLink[adNum];
//for (var i=1;i<=count;i++){
//document.getElementById('b'+i).className = button_off;
//}
//document.getElementById('b'+adNum).className = button_on;
//document.getElementById('focustext').innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd_2()", TimeOut);
}
/* show_1 */
function show_1(){
document.write('<div id="focuse">');
document.write('<DIV id="oTransContainer" style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion=forward); WIDTH: '+imgWidth+'; HEIGHT: '+imgHeight+'">');
//图片
for(var i=0;i<count+1;i++){
if (adNum==i){document.write('<img id="oDIV'+i+'" src="'+imgUrl[i]+'" width='+imgWidth+' height='+imgHeight+' border=0 style='+imgStyle+'>');}
else{document.write('<img id="oDIV'+i+'" src="'+imgUrl[i]+'" width='+imgWidth+' height='+imgHeight+' border=0 style="DISPLAY: none" style='+imgStyle+'>');}
}
document.write('</div>');
// document.write('<div id="focustext" style="'+focustextStyle+'">'+imgtext[1]+'</div>');
document.write('</div>');
nextAd_1();
}
/* show_2 */
function show_2(){
document.write('<div id="focuse">');
document.write('<img src="'+imgUrl[adNum]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=0 style='+imgStyle+'>');
//document.write('<div id="focustext" style="'+focustextStyle+'">'+imgtext[1]+'</div>');
document.write('</div>');
theTimer=setTimeout("nextAd_2()", TimeOut);
}
/* goUrl() */
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
/* playTran() */
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
function menu_action(obj){
for (var i=1;i<=5;i++){
document.getElementById('menu'+i).className='menu_out';}
obj.className='menu_over';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -