我想找一个Dreamweaver浮动图片的代码,网上有许多,但是都是要链接网上的图片,能不能指认自己电脑上的路径就能用的????
SOS高手来帮一下忙!!!!!!谢谢 !!!!!
參考答案:<html>
<head>
<title>图片随意飘动</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.zf {
border: #999999;
border-style: solid;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
cursor: hand;
}
-->
</style>
</head>
<body bgcolor=#FFFFFF>
<div id="img" style="position:absolute; left: 0px; top: 330px;">
<table id="one" style="display: " border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="MyJS.htm"><img src="images/1.jpg" width="120" height="113" border="0" onClick="pause_resume();"></a></td>
<td> <a style="cursor:hand " onClick="Cl()">关闭</a></td>
</tr>
</table>
</div>
<script language="javascript">
function Cl(){
one.style.display="none";
}
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function start() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume() {
if(pause) {
clearInterval(interval);
pause = false;
}
else {
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();
// End -->
</script>
</div>
</body>
</html>
=================================================================
<a href="MyJS.htm"><img src="images/1.jpg" width="120" height="113" border="0" onClick="pause_resume();"></a>
这里改连接 和图片地址