⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 img.js

📁 程序安装简便容易
💻 JS
字号:

isns = navigator.appName == "Netscape";

function ztstr(id,picurl,linkurl,title)
{	this.id=id;
	this.picurl=picurl;
	this.linkurl=linkurl;
	this.title = title;

}


	imgcount=1;
	//变化频率
	frequency=6*1000;
	toppic=new Array();
function startPicShow()
{
	imgcount=toppic.length-1;
	for(i=1;i<=imgcount;i++)
	{
		eval("img"+i+"=new Image()")
		eval("img"+i+".src=toppic["+i+"].picurl")
	}

	swapPic();
}

nn=1

var rand1 = 0;
var useRand = 0;
function swapPic()
{
	var imgnum = toppic.length - 1;
	do {
	var randnum = Math.random();
	rand1 = Math.round((imgnum - 1) * randnum) + 1;
	} while (rand1 == useRand);
	useRand = rand1;
	// alert(useRand);
	nn=useRand;
	change_img();
}

function change_img()
{
    if(document.toppic_img){
    document.toppic_img.style.filter = 'revealtrans(duration=2.0,transition='+(Math.random()*23)+')';
	eval('document.toppic_img.src=img'+nn+'.src');
	eval('document.getElementById("toppic_lblTitle").innerText=toppic['+nn+'].title');
	nn++;
	if(nn>imgcount) nn=1
	if(!isns)
	{
		document.toppic_img.filters.item(0).apply();
		document.toppic_img.style.visibility='visible';
		document.toppic_img.filters.item(0).play();
		document.getElementById("toppic_lblTitle").style.visibility='visible';
		//alert(document.getElementById("toppic_lblTitle").style.visibility);
		//setTimeout("document.toppic_img.style.visibility='hidden';",frequency);
		//setTimeout(document.getElementById("toppic_lblTitle").style.visibility='hidden;",frequency);

		//document.toppic_lblTitle.style.visibility='visible';
		//setTimeout("document.toppic_lblTitle.style.visibility='hidden'",frequency);
	}
	else
	{
		document.toppic_img.visibility='visible';
		//document.toppic_lblTitle.visibility='visible';
	}
	tt=setTimeout('change_img()',frequency);
    }
}

function pictarget()
{
tt=nn-1
if(tt<1) tt=imgcount
cururl=toppic[tt].linkurl
window.open(cururl);
}
function ini()
{
if(!isns)
{
spacewidth=Math.round((divmask.offsetWidth-770)/2)
dmwidth=770+spacewidth
dmheight=divmask.offsetHeight
totalstep=50
timeout=50
dmstepw=Math.round(770/totalstep)
dmsteph=Math.round(dmheight/totalstep)
setTimeout('hidimg()',3000)
}
else swapPic()
}

function hidimg()
{
dmwidth-=dmstepw
dmheight-=dmsteph
eval('divmask.style.clip="rect(0,'+dmwidth+','+dmheight+',0)"')
hdrun=setTimeout('hidimg()',timeout)
if(dmwidth<=spacewidth&&dmheight<=0)
{
divmask.style.visibility='hidden'
clearTimeout(hdrun)
swapPic()
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -