ad.js

来自「Dm9000网络接口驱动大全」· JavaScript 代码 · 共 62 行

JS
62
字号
function startmarquee(lh,speed,delay) {
	var p=false;
	var t;
	var o=document.getElementById("marqueebox");
	o.innerHTML+=o.innerHTML;
	o.style.marginTop=0;
	o.onmouseover=function(){p=true;}
	o.onmouseout=function(){p=false;}

	function start(){
		t=setInterval(scrolling,speed);
		if(!p) o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
	}
	function scrolling(){
		if(parseInt(o.style.marginTop)%lh!=0){
		o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
		if(Math.abs(parseInt(o.style.marginTop))>=o.scrollHeight/2) o.style.marginTop=0;
		}else{
		clearInterval(t);
		setTimeout(start,delay);
	}
}
setTimeout(start,delay);
}


var p_ul_img;
function loadTopic()
{
	send_request("GET","http://www.386job.com/data/newjob.xml?1=1" ,null,"xml",stateChanged_topic);
	return;
}
function stateChanged_topic()
{
	if (http_request.readyState==4 || http_request.readyState=="complete")
	{	var counter;
	    counter=0;
		var xmlDom=http_request.responseXML;
		var tmpHTML;
		tmpHTML="<table width=100% cellspacing=0 margin=0 style='padding:0px;margin:0px;' cellpadding=0 border=0><Tr>";
		for(var i=0;i<xmlDom.selectNodes("xml/topic").length;i++)
		{
		    counter++;
			tmpHTML+="<td><div width='25%'>·<A class='"+ xmlDom.selectNodes("xml/topic/@class").item(i).text +"' href='"+ xmlDom.selectNodes("xml/topic/@url").item(i).text +"' target='_blank'>"
			tmpHTML+=xmlDom.selectNodes("xml/topic/@title").item(i).text +"</A></td>"
			if(counter==4)
			{
			    counter=0;
			    if(i==xmlDom.selectNodes("xml/topic").length-1) 
		        {
		            tmpHTML+="</Tr></table>";
		        }
		        else
		        {
		            tmpHTML+="</Tr><Tr>";
		         }
			}
		}
		document.getElementById("marqueebox").innerHTML=tmpHTML;
        startmarquee(18,1,2500);
	}	
}

⌨️ 快捷键说明

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