<div id="attribute" style="">
<table><tr>
<td>
<IFRAME allowTransparency="true" src=""></IFRAME>
</td>
</tr>
</table>
</div>其中的src是在程序中使用javascript加载的,这样在它加载的页面上是这样写的
<body bgcolor="#F7F7F7" style = "background-color:transparent">
可是这样不能实现透明啊
<table><tr>
<td>
<IFRAME allowTransparency="true" src=""></IFRAME>
</td>
</tr>
</table>
</div>其中的src是在程序中使用javascript加载的,这样在它加载的页面上是这样写的
<body bgcolor="#F7F7F7" style = "background-color:transparent">
可是这样不能实现透明啊
<!--
var currentMoveObj = null; //当前拖动对象
var relLeft; //鼠标按下位置相对对象位置
var relTop;
function f_mdown(obj)
{
currentMoveObj = obj; //当对象被按下时,记录该对象
currentMoveObj.style.position = "absolute";
relLeft = event.x - currentMoveObj.style.pixelLeft;
relTop = event.y - currentMoveObj.style.pixelTop;
}
window.document.onmouseup = function()
{
currentMoveObj = null; //当鼠标释放时同时释放拖动对象
}
function f_move(obj)
{
if(currentMoveObj != null)
{
currentMoveObj.style.pixelLeft=event.x-relLeft;
currentMoveObj.style.pixelTop=event.y-relTop;
}
}//-->
</SCRIPT>
<BODY>
<TABLE width="100" border=1 onselectstart="return false" style="position:absolute;left:50;top:50" onmousedown="f_mdown(this)" onmousemove="f_move(this)">
<TR>
<TD bgcolor="#CCCCCC" align="center" style="cursor:move">title1</TD>
</TR>
<TR>
<TD align="center" height="60">content</TD>
</TR>
</TABLE>
<TABLE width="100" border=1 onselectstart="return false" style="position:absolute;left:350;top:250" onmousedown="f_mdown(this)" onmousemove="f_move(this)">
<TR>
<TD bgcolor="#CCCCCC" align="center" style="cursor:move">title2</TD>
</TR>
<TR>
<TD align="center" height="60">content</TD>
</TR>
</TABLE>
</BODY>
我把相关的代码方到我的网页中就不行啊
我使用的是一个div
div中方一些table
<head>
<style>
img
{
position:relative;
}
</style>
<script type="text/javascript">
mouseover=true
function coordinates()
{
if (!moveMe)
{
return
}
if (event.srcElement.id=="moveMe")
{
mouseover=true
pleft=document.getElementById('moveMe').style.pixelLeft
ptop=document.getElementById('moveMe').style.pixelTop
xcoor=event.clientX
ycoor=event.clientY
document.onmousemove=moveImage
}
}function moveImage()
{
if (mouseover&&event.button==1)
{
document.getElementById('moveMe').style.pixelLeft=pleft+event.clientX-xcoor
document.getElementById('moveMe').style.pixelTop=ptop+event.clientY-ycoor
return false
}
}function mouseup()
{
mouseover=false
}
document.onmousedown=coordinates
document.onmouseup=mouseup
</script>
</head>
<body>
<img id="moveMe" src="smiley.gif" width="32" height="32"><br />
<b>Drag and drop the image</b>
</body>
</html>