js|脚本|原创|执行|浮动|特效
http://js.alixixi.com特效运行框功能代码
以下是HTML文件: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE>mapstyle</TITLE> <SCRIPT language=javascript src="mapstyle/jsrun.js" type=text/javascript></SCRIPT> |
以下是JS文件: // bigin fly bar var bIsCatchFlyBar = false; var dragClickX = 0; var dragClickY = 0; function HideFlyBar(){ document.getElementById("divFlyBar").style.visibility = "hidden"; //myFlyBarRestorButton.style.display = ’’; } function openFlyBar(id){ //alert(document.getElementById("runid").src); document.getElementById("runid").src=’map.asp?mapid=’+id; document.getElementById("divFlyBar").style.display = ""; myload_flybar(); document.getElementById("divFlyBar").style.visibility = "visible"; //myFlyBarRestorButton.style.display = "none"; } function catchFlyBar(e){ bIsCatchFlyBar = true; var x=event.x+document.body.scrollLeft; var y=event.y+document.documentElement.scrollTop; dragClickX=x-document.getElementById("divFlyBar").style.pixelLeft; dragClickY=y-document.getElementById("divFlyBar").style.pixelTop; document.getElementById("divFlyBar").setCapture(); document.onmousemove = moveFlyBar; } function releaseFlyBar(e){ bIsCatchFlyBar = false; document.getElementById("divFlyBar").releaseCapture(); document.onmousemove = null; } function moveFlyBar(e){ if(bIsCatchFlyBar){ document.getElementById("divFlyBar").style.left = event.x+document.body.scrollLeft-dragClickX; document.getElementById("divFlyBar").style.top = event.y+document.documentElement.scrollTop-dragClickY; } } function myload_flybar(){ // alert(document.documentElement.scrollTop); document.getElementById("divFlyBar").style.top=document.documentElement.scrollTop; //document.getElementById("divFlyBar").style.left=document.body.offsetWidth/2.7; document.getElementById("divFlyBar").style.left=document.body.offsetWidth-document.getElementById("divFlyBar").clientWidth-30+document.body.scrollLeft; } window.onresize = myload_flybar; window.onscroll = myload_flybar; //window.onload = openFlyBar; // end fly bar |