珠海那些商场:在网页中怎么在600*800图片上面,再显示一个16*16的图片,

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 13:26:17
并且.我想要显示在哪个坐标就显示哪个坐标.也就是这个16*16的图片显示在800*600上面位子是不固定的.

做个拖拽的广告样式!你把下面这段代码认识一下,就知道了!

第一步:把如下代码加入<body>区域中
<style type="text/css">
body,td,a { font-size: 9pt; color: #330000; text-decoration: none}
.aa {filter:alpha(opacity=70)}
</style>
<div style="position:absolute; left:10px; top:92px;solid;cursor:move" onmousedown="down1(this)" class="aa" id=plane0>
<table cellpadding="0" border="0" cellspacing="1" width="200" height="100" bgcolor="#000000" >
<tr>
<td height="18" bgcolor="#E28EEE" >
<div align="right">关于本站 <a href="#" onClick="clase(0)">关闭</a></div>
</td></tr><tr>
<td bgcolor="#FCE3FD">本站是网页制作的专业网站。</td>
</tr></table></div>

<div style="position:absolute;left:10px;top:172px;z-index:1;solid;cursor:move" id=plane1 onmousedown="down1(this)" class="aa">
<table cellpadding="0" border="0" cellspacing="1" width="200" height="100" bgcolor="#000000" >
<tr>
<td height="18" bgcolor="#E28EEE" >
<div align="right">返回目录 <a href="javascript:" onClick="clase(1)">关闭</a></div>
</td></tr><tr>
<td bgcolor="#FCE3FD"><a href="../wytx.htm">返回目录</a></td>
</tr></table></div>

<script>
var over=false,down=false,divleft,divtop,n;
function clase(x){document.all['plane'+x].style.visibility='hidden'}
function down1(m){
n=m;down=true;divleft=event.clientX-parseInt(m.style.left);divtop=event.clientY-parseInt(m.style.top)}
function move(){if(down){n.style.left=event.clientX-divleft;n.style.top=event.clientY-divtop;}}</script>

<a href="javascript:" onClick="plane0.style.visibility='visible'">关于本站</a>
<a href="javascript:" onClick="plane1.style.visibility='visible'">返回目录</a>

第二步:修改<body***>中的内容,将下面的代码加入原<body***>中
onmousemove="move()" onmouseup="down=false"

<div><img src='' width=800 height=600 />
<div style='position:relative;left:200px;top:-300px'><img src='' width=16 height=16 /></div></div>

改一下left和top的值即可...