<td><div style="width:100%;height:100%"></div></td>
解决方案 »
- 如何点击IE右键某一添加项,调用远程的js?
- 获取页面标题的代码,火狐下不能通过,求助!
- css滤镜在windows 2003 下没有效果。。真急人
- javascript 调用问题 急,在线等
- 通过js获得客户端的某个文件夹内容,然后调用java类方法进行处理,获得一个字符串数组传给servlet,可以实现么?【求指导】
- jquery-1.4.4.min.js为啥报这个错?
- [easyui]关于treegrid编辑时validatebox的长度限制
- 拖动滚动条时候,图片也随着移动 ,如何实现??
- 如何修改IE状态栏进度条指示的的框架?
- 求解决ckeditor不支持带.符号的字体
- 高分求解! 在线等
- mailto正文中的换行符
------------------------------------------
<style>
div.float {
background:transparent;
position:absolute;
z-index:99;
star : expression(this.style.left = getPositionX(this.t), this.style.top = getPositionY(this.t), this.style.width = eval(this.t).clientWidth, this.style.height = eval(this.t).clientHeight)
}
</style>
<script>
function getPositionX(t)
{
var obj = eval(t)
var x = obj.offsetLeft
while(obj = obj.offsetParent)
{
x += obj.offsetLeft
}
return x
}
function getPositionY(t)
{
var obj = eval(t)
var y = obj.offsetTop
while(obj = obj.offsetParent)
{
y += obj.offsetTop
}
return y
}
</script><div class="float" t=td1 style="border:1px red solid;"> 456</div>
<div class="float" t=td2 style="border:1px blue solid;"> 456</div>
<table border="1" bgcolor=#efefef>
<tr>
<td width="120" height="22" id="td1">123 </td>
<td width="130" id="td2">123 </td>
</tr>
</table>
----------------------
<style>
div.float {
background:transparent;
position:absolute;
z-index:99;
star : expression(this.style.left = getPositionX(this.t), this.style.top = getPositionY(this.t), this.style.width = eval(this.t).clientWidth+1, this.style.height = eval(this.t).clientHeight+2)
}
</style>
<script>
function getPositionX(t)
{
var obj = eval(t)
var x = obj.offsetLeft
while(obj = obj.offsetParent)
{
x += obj.offsetLeft
}
return x
}
function getPositionY(t)
{
var obj = eval(t)
var y = obj.offsetTop
while(obj = obj.offsetParent)
{
y += obj.offsetTop
}
return y
}
</script><div class="float" t=td1 style="border:1px red solid;"> 456</div>
<div class="float" t=td2 style="border:1px blue solid;"> 456</div>
<table border="1" bgcolor=#efefef>
<tr>
<td width="120" height="22" id="td1">123</td>
<td width="130" id="td2">123 </td>
</tr>
</table>
<input type="button" onclick="td1.innerText=td1.innerText=='123'?'层的长宽根据实际情况做些修正即可':'123'" value="click">
t=td1
这两句我理解不到
while(obj = obj.offsetParent)
{
y += obj.offsetTop
}
为什么取得了td1.offsetTop之后,DIV还不能直接定位到td1上去,还要做y+=td1.offsetTop的运算呢?
t=td1 也是利用了自定义属性,目的是用来配置层对应的单元格的id
说明:imgch是一个td的id
<script>
onload=function changeimg()
{
var x=0;
var y=0;
var obj=document.all.imgch;
while(obj.offsetParent!=null)
{
obj=obj.offsetParent;
x+=parseInt(document.all.imgch.offsetLeft);
y+=parseInt(document.all.imgch.offsetTop);
}document.all.jsjs.style.width=document.all.imgch.clientWidth;
document.all.jsjs.style.height=document.all.imgch.clientHeight;document.all.jsjs.style.left=x;
document.all.jsjs.style.top=y;
x=0;
y=0;}
</script>
<body style="LEFT: 0px; FLOAT: right; WIDTH: 772px; POSITION: absolute; TOP: 0px" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" MS_POSITIONING="GridLayout">
<div id="jsjs" style="COLOR: #660033; POSITION: absolute; BACKGROUND-COLOR: #ffcc66"></div>
<table width="772" height="100" border="0" align="center" cellpadding="0" cellspacing="0"
id="Table1" name="Table1">
<tr>
<td colspan="2" align="center"><img src="./images/aa.gif" width="772" height="95"></td>
</tr>
<tr align="center" valign="middle">
<td width="101" height="79" align="center" style="BORDER-RIGHT:0px; BORDER-TOP:0px; BORDER-LEFT:0px; BORDER-BOTTOM:0px"><img src="" id="img1" width="100" height="90">
</td>
<td id="imgch" width="671">
<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
height="100%" width="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>
<PARAM NAME="_cx" VALUE="16748">
<PARAM NAME="_cy" VALUE="2487">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="wbt.swf">
<PARAM NAME="Src" VALUE="wbt.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="always">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<embed src="wbt.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="100%" height="100%"></embed>
</OBJECT>
</td>
</tr>
</table>
<script>
onload=function changeimg()
{
var obj=document.all.imgch;
var x=obj.offsetLeft;
var y=obj.offsetTop;
while(obj.offsetParent!=null)
{
obj=obj.offsetParent;
x+=obj.offsetLeft;
y+=obj.offsetTop;
}
document.all.jsjs.style.width=document.all.imgch.clientWidth+2;
document.all.jsjs.style.height=document.all.imgch.clientHeight+2;
document.all.jsjs.style.left=x;
document.all.jsjs.style.top=y;
x=0;
y=0;
}
</script>
<body style="LEFT: 0px; FLOAT: right; WIDTH: 772px; POSITION: absolute; TOP: 0px" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" MS_POSITIONING="GridLayout">
<div id="jsjs" style="COLOR: #660033; POSITION: absolute; BACKGROUND-COLOR: #ffcc66; border:1px solid blue"></div>
<table width="772" height="100" border="0" align="center" cellpadding="0" cellspacing="0"
id="Table1" name="Table1">
<tr>
<td colspan="2" align="center"><img src="./images/aa.gif" width="772" height="95"></td>
</tr>
<tr align="center" valign="middle">
<td width="101" height="79" align="center" style="BORDER-RIGHT:0px; BORDER-TOP:0px; BORDER-LEFT:0px; BORDER-BOTTOM:0px"><img src="" id="img1" width="100" height="90">
</td>
<td id="imgch" width="671" style=" border:1px solid red">
</td>
</tr>
</table>
应该如何做,才能让这个div浮在flash之上??
----------------------------------------
<script>
onload=function changeimg()
{
var obj=document.all.imgch;
var x=obj.offsetLeft;
var y=obj.offsetTop;
while(obj.offsetParent!=null)
{
obj=obj.offsetParent;
x+=obj.offsetLeft;
y+=obj.offsetTop;
}
document.all.jsjs.style.width=document.all.imgch.clientWidth+2;
document.all.jsjs.style.height=document.all.imgch.clientHeight+2;
document.all.jsjs.style.left=x;
document.all.jsjs.style.top=y;
ifm.document.open()
ifm.document.close()
ifm.document.write ("<span style='color:red;width:100%;height:100%;text-align:center;vertical-align:middle;'>文字</span>")
x=0;
y=0;
}
</script>
<body style="LEFT: 0px; FLOAT: right; WIDTH: 772px; POSITION: absolute; TOP: 0px" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" MS_POSITIONING="GridLayout">
<div id="jsjs" style="COLOR: #660033; POSITION: absolute; BACKGROUND-COLOR: #ffcc66; border:1px solid blue">
<iframe id="ifm" src="" border=0 frameborder=0 style="width:100%;height:100%"></iframe>
</div>
<table width="772" height="100" border="0" align="center" cellpadding="0" cellspacing="0"
id="Table1" name="Table1">
<tr>
<td colspan="2" align="center"><img src="./images/aa.gif" width="772" height="95"></td>
</tr>
<tr align="center" valign="middle">
<td width="101" height="79" align="center" style="BORDER-RIGHT:0px; BORDER-TOP:0px; BORDER-LEFT:0px; BORDER-BOTTOM:0px"><img src="" id="img1" width="100" height="90">
</td>
<td id="imgch" width="671" style=" border:1px solid red">
<param name="wmode" value="opaque"><embed src="http://images.csdn.net/20050809/news_channel_banner_468x6001.swf" quality=high width="100%" height="90"></embed>
</td>
</tr>
</table>
<button onclick="aa()">click</button>
<script>
function aa()
{
if(jsjs.children.length>0)
{
jsjs.removeChild(jsjs.children[0])
}
else
{
jsjs.innerHTML = '<iframe id="ifm" src="" border=0 frameborder=0 style="width:100%;height:100%"></iframe>';
ifm.document.write ('<span style="color:red;width:100%;height:100%;text-align:center;vertical-align:middle;">文字</span>')
}
}
</script>
与<td></td>中的flash交替显示在下想要的效果是让div中显示出文字,然后朦在flash上,或者说是flash与div 同时显示