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

📄 sponser.js

📁 网络硬盘_支持1GB文件上传和续传_无错版
💻 JS
字号:
/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Modified by Stephen Yabziz
* Visit http://www.dynamicdrive.com/ for full script
* This notice must stay intact for use
******************************************/

/***********************************
* setting for sponser ad
************************************/
var shakeTime=2000; // shake time for advertisement
var startShow=2000; //how long to begin to show advertisement
var AdTop = 200; //top of advertisement
var AdLeft = 500; // left of advertisement
var slideStep = 15; // 0 will dissble the slide down
var slideInternal = 10; //1000 = 1 seconds
/***********************************/

var adDiv;
var TO = null;
var Slide = null;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
var curHeight = 0;
var shakePos = 5;

function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sponsorAdDiv.style');
	else if(ns)	adDiv=eval('document.layers["sponsorAdDiv"]');
	else if(w3)	adDiv=eval('document.getElementById("sponsorAdDiv").style');

    setTimeout("showAd();", startShow);
}
function shakeAd(object,speed)
{
    tmpobj = eval(object)

    if (shakePos == 5)
    {
        shakePos = -5;
    }
    else
    {
        shakePos = 5;
    }
    tmpobj.left = parseInt(tmpobj.left) + shakePos + calunit;
    tmpobj.top = parseInt(tmpobj.top) + shakePos + calunit;
    tmpobj = object;

    sp = speed;
    TO = setTimeout("shakeAd(tmpobj,sp)",speed);
}
function stopshake()
{
	clearTimeout(TO);
}
function slideAd()
{
    var stopSlide = 1;

    //detect the current postion
	if (ie){documentWidth  =AdLeft+truebody().scrollLeft-20;
	documentHeight = (slideStep>0 && curHeight<=AdTop+truebody().scrollTop-20) ? curHeight:AdTop+truebody().scrollTop;
    stopSlide = !(slideStep>0 && curHeight<=AdTop+truebody().scrollTop-20);}
	else if (ns){documentWidth=AdLeft+window.pageXOffset-20;
	documentHeight = (slideStep>0 && curHeight<=AdTop+window.pageYOffset-20) ? curHeight:AdTop+window.pageYOffset-20;
    stopSlide = !(slideStep>0 && curHeight<=AdTop+window.pageYOffset-20);}
	else if (w3){documentWidth=AdLeft+window.pageXOffset-20;
	documentHeight = (slideStep>0 && curHeight<=AdTop+window.pageYOffset-20) ? curHeight:AdTop+window.pageYOffset-20;
    stopSlide = !(slideStep>0 && curHeight<=AdTop+window.pageYOffset-20);}

    //assign to sponser box
    adDiv.left=documentWidth+calunit;
    adDiv.top =documentHeight+calunit;
    
    //increase curheight
    curHeight=curHeight+slideStep;

    //decide next action
    if(stopSlide)
    {
        clearTimeout(Slide);
        shakeAd(adDiv,75);
        setTimeout("stopshake()",shakeTime);
    }
    else
    {
        Slide = setTimeout("slideAd()",slideInternal);
    }
    
}
function showAd()
{
    //slide the ads,slideStep=0 can disbale slide
    slideAd();
    
    //show the ads
    if (ie||w3)
    adDiv.visibility="visible";
    else
    adDiv.visibility ="show";
    
    //bind to scroll event to the moveAd
    if (ie) window.onscroll = moveAd;
}
function moveAd()
{
    //detect the current postion
    if (ie){documentWidth  =AdLeft+truebody().scrollLeft-20;
	documentHeight =AdTop+truebody().scrollTop-20;}
	else if (ns){documentWidth=AdLeft+window.pageXOffset-20;
	documentHeight=AdTop+window.pageYOffset-20;}
	else if (w3){documentWidth=AdLeft+window.pageXOffset-20;
	documentHeight=AdTop+window.pageYOffset-20;}

    //assign to sponser box
    adDiv.left=documentWidth+calunit;
    adDiv.top =documentHeight+calunit;
}
function closeAd(){
	if (ie||w3)
	adDiv.display="none";
	else
	adDiv.visibility ="hide";
 
    if (ie) window.onscroll = null;
}

function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

⌨️ 快捷键说明

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