我怎改都是错,我不懂,请问有高手指点吗?代码如下,我只想要红色内容的功能,请问如何实现呢?
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
}
function rand(number) {
return Math.ceil(rnd()*number);
}
function gainoverflash(wid,hei,gnt,gnl,gnurl)
{
Mlogo.innerHTML+="<embed src='"+gnurl+"' width='"+wid+"' height='"+hei+"' wmode='transparent' style='position:absolute;top:"+gnt+";left:"+gnl+"'></embed>"
}
function gainoverpic(wid,hei,gnt,gnl,gnurl,gnz)
{
Mlogo.innerHTML+="<div style='position:absolute;top:"+gnt+";left:"+gnl+";z-index:"+gnz+";'><img src='"+gnurl+"' width='"+wid+"' height='"+hei+"'></img></div>"
}
function gnflower(rurl,furl,gnum,burl,SunPot, LovPot, RaiPot, NurPot)
{
var str= '<table width="194" height="170" border="0" cellpadding="0" cellspacing="0" background="'+burl+'">'
str+='<tr><td rowspan="3"> </td>'
str+='<td width="27" height="42" align="center" valign="bottom"><img src="http://imgcache.qq.com/qzone/client/icon_ft.gif" width="27" height="5"></td>'
str+='<td width="6" rowspan="3"> </td>'
str+='<td width="27" align="center" valign="bottom"><img src="http://imgcache.qq.com/qzone/client/icon_ft.gif" width="27" height="5"></td>'
str+='<td width="6" rowspan="3"> </td>'
str+='<td width="27" align="center" valign="bottom"><img src="http://imgcache.qq.com/qzone/client/icon_ft.gif" width="27" height="5"></td>'
str+='<td width="6" rowspan="3"> </td>'
str+='<td width="27" align="center" valign="bottom"><img src="http://imgcache.qq.com/qzone/client/icon_ft.gif" width="27" height="5"></td>'
str+='<td rowspan="3"> </td></tr><tr>'
str+='<td width="27" height="80" align="center" valign="bottom" background="http://imgcache.qq.com/qzone/client/icon_fm.gif" title="阳光:'+SunPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_f1.gif" width="27" height="'+(((SunPot>200)?200:SunPot)/2)*0.8+'"></td>'
str+='<td width="27" align="center" valign="bottom" background="http://imgcache.qq.com/qzone/client/icon_fm.gif" title="爱心:'+LovPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_f2.gif" width="27" height="'+(((LovPot>200)?200:LovPot)/2)*0.8+'"></td>'
str+='<td width="27" align="center" valign="bottom" background="http://imgcache.qq.com/qzone/client/icon_fm.gif" title="雨露:'+RaiPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_f3.gif" width="27" height="'+(((RaiPot>200)?200:RaiPot)/2)*0.8+'"></td>'
str+='<td width="27" align="center" valign="bottom" background="http://imgcache.qq.com/qzone/client/icon_fm.gif" title="营养:'+NurPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_f4.gif" width="27" height="'+(((NurPot>200)?200:NurPot)/2)*0.8+'"></td></tr><tr>'
str+='<td width="27" height="21" align="center" valign="top" title="阳光:'+SunPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_fd.gif" width="27" height="5"><img src="http://imgcache.qq.com/qzone/client/icon_b1.gif" width="16" height="16"></td>'
str+='<td width="27" align="center" valign="top" title="爱心:'+LovPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_fd.gif" width="27" height="5"><img src="http://imgcache.qq.com/qzone/client/icon_b2.gif" width="16" height="16"></td>'
str+='<td width="27" align="center" valign="top" title="雨露:'+RaiPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_fd.gif" width="27" height="5"><img src="http://imgcache.qq.com/qzone/client/icon_b3.gif" width="16" height="16"></td>'
str+='<td width="27" align="center" valign="top" title="营养:'+NurPot+'"><img src="http://imgcache.qq.com/qzone/client/icon_fd.gif" width="27" height="5"><img src="http://imgcache.qq.com/qzone/client/icon_b4.gif" width="16" height="16"></td>'
str+='</tr><tr><td width="49"> </td>'
str+='<td colspan="7" align="center" valign="top"><font color="#000000">'
switch (parseInt(gnum)){
case 0:
str+='花匠学徒';
break;
case 1:
str+='花匠学徒';
break;
case 2:
str+='高级花匠';
break;
case 3:
str+='花匠大师';
break;
case 4:
str+='花之圣手';
break;
case 5:
str+='花之神匠';
break;
}
str+='</font><a href="http://q-zone.qq.com/web/?url=http://q-zone.qq.com/web/help/help_18.shtml#111" target="_blank"><img src="http://imgcache.qq.com/qzone/client/bt_help.gif" hspace="2" alt="帮助" border="0" align="absmiddle"></a></td>'
str+='<td width="19"> </td></tr></table>'
Mlogo.innerHTML+="<div id='gnck' style='position:absolute;top:470;left:720;z-index:1004;'></div><div id='gnban' style='position:absolute;top:480;left:731;z-index:1002;'></div>"
document.getElementById('gnban').innerHTML=str;
document.getElementById('gnck').innerHTML="<table border=0 cellspacing=0 cellpadding=0 onmouseover=this.style.cursor=\'hand\';><tr><td onclick=gnhide(); align=center><img src=http://yuayus.cwsurf.de/img/tansfer.gif border=0 width=92 height=178></td></tr></table>"
gainoverpic('868','60','605','10',rurl,'1001');
gainoverpic('75','100','383','715','http://imgcache.qq.com/qzone/mall/guo_5.gif','1001');
gainoverpic('92','178','471','710',furl,'1003');
}
function gnhide()
{
document.getElementById('gnban').style.display=(document.getElementById('gnban').style.display)?'':'none'
}
gainoverflash('150','162','300','760','http://219.131.221.186:7474/mtv/tiao.swf');
var n=rand(5);
function gnrndf()
{
if (n==1)
{
gnflower
('http://imgcache.qq.com/qzone/item/orig/12/2364_r5.gif','http://imgcache.qq.com/qzone/item/orig/12/2364_f5.gif','5','http://imgcache.qq.com/qzone/item/orig/12/2364_bg.gif','999','999','999','999')
}
else if (n==2)
{
gnflower('http://imgcache.qq.com/qzone/item/orig/5/2469_r5.gif','http://imgcache.qq.com/qzone/item/orig/5/2469_f5.gif','5','http://imgcache.qq.com/qzone/item/orig/5/2469_bg.gif','999','999','999','999')
}
else if (n==3)
{
gnflower('http://imgcache.qq.com/qzone/item/orig/11/2363_r5.gif','http://imgcache.qq.com/qzone/item/orig/11/2363_f5.gif','5','http://imgcache.qq.com/qzone/item/orig/11/2363_bg.gif','999','999','999','999')
}
else if (n==4)
{
gnflower('http://imgcache.qq.com/qzone/item/orig/10/2362_r5.gif','http://imgcache.qq.com/qzone/item/orig/10/2362_f5.gif','5','http://imgcache.qq.com/qzone/item/orig/10/2362_bg.gif','999','999','999','999')
}
else if (n==5)
{
gnflower('http://imgcache.qq.com/qzone/item/orig/1/2161_r5.gif','http://imgcache.qq.com/qzone/item/orig/1/2161_f5.gif','5','http://imgcache.qq.com/qzone/item/orig/1/2161_bg.gif','999','999','999','999')
}
}
gnrndf();
[此贴子已经被作者于2005-10-31 9:51:49编辑过]