5

js代码能不能做出跨iframe显示悬浮层内容

 <script language="JavaScript">
var currentpos,timer;
function initialize(){
timer=setInterval("scrollwindow()",1);
}
function sc(){
clearInterval(timer);
}
function scrollwindow(){
currentpos=document.body.scrollTop; window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop) sc();
}
document.onmousedown=sc;document.ondblclick=initialize;
function New(para_URL){
var URL =new String(para_URL);
window.open(URL,'','resizable,scrollbars')
}
function ShowTips(uurl,pThis){
Hiddenmy();window.open(uurl,'show');
var pTip = document.all['Tips'].style ;
pTip.left = 1 ;
pTip.top = pThis.offsetHeight  + getPos(pThis,'top');
pTip.width = 130;
pTip.display ='';   
if(Tips.offsetTop + Tips.offsetHeight > document.body.offsetHeight)pTip.top = getPos(pThis,'top') - Tips.offsetHeight;
}
function Showmy(data,pThis){
lis = data.split('|');
s='<table width=110 height=206 border=0 cellpadding=0 cellspacing=0 background=';if(lis[8]==1){s+='ztimg/renwxx.gif';}else{s+='ztimg/renwxx.gif';
} 
s+='><tr><td width=100% align=center><div style=margin:5px;><img src='+lis[4]+' width=80 height=80></div></td></tr>';
s+='<tr><td colspan=2 valign=top><div style=margin-left:10px><font class=xinxi>门派:<font color=green>'+lis[2]+'</font></font><br><font class=xinxi>身份:<font color=green>'+lis[3]+'</font></font><br>';
s+='<font class=xinxi>';if(lis[1]=='男'){s+='娘子:<font color=c80000>"+mywife+"</font>';}else{s+='相公:<font color=c80000>"+mywife+"</font>';}s+='<br>阵营:<font color=c80000>'+lis[10]+'派阵营</font></font><br>';
s+='转职:<font color=c80000>'+lis[11]+'</font>转<Br>名声:<font color=c80000>'+lis[12];if(lis[2]!='NPC'){s+='</font><br>';if(lis[7]==0){s+='0级VIP用户<img src=images/hb/0.gif>';};if(lis[7]==1){s+='1级VIP用户<img src=images/hb/1.gif>';};if(lis[7]==2){s+='2级VIP用户<img src=images/hb/1.gif>';};if(lis[7]==3){s+='3级VIP用户<img src=images/hb/3.gif>';};if(lis[7]==4){s+='4级VIP用户<img src=images/hb/4.gif>';}}s+='</font></div></td></tr></table>';
myTips.innerHTML = s;
var pTip = document.all['myTips'].style ;
pTip.left = 83 ;
pTip.top = -36  + getPos(pThis,'top');
pTip.width = 130;
pTip.display ='';   
if(Tips.offsetTop + Tips.offsetHeight > document.body.offsetHeight)pTip.top = getPos(pThis,'top') - Tips.offsetHeight+20;}
function Hiddenmy(){var obj = document.all['myTips'].style;obj.left =0;obj.top =0;obj.display='none';}
function Hidden(){this.show.location.href='about:blank';var obj = document.all['Tips'].style;obj.left =0;obj.top =0;obj.display = 'none';}
function getPos(obj,type){var n = 0 ;while(obj!=null){if(type=='top'){n += obj.offsetTop;}else{n += obj.offsetLeft;}obj = obj.offsetParent ;}return n;}
</script>
查看全部
dabocaiqq
珍爱生命抵制问答从我做起告别缺德的网站
2018/06/10 03:08
  • string
  • class
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复