<!---飘窗开始--->
<div id="img1" style="z-index: 999; border: 1px solid rgb(204, 204, 204); width: 340px; background-color: white; height: 150px; position: absolute; top: 175px; left: 25px; font-size: 13px;" >
<div style="height:18px;margin-left:310px;margin-top:6px;">
<a href="javascript:void(0);" onclick="closediv()" title="点击关闭" style="height:16px;text-decoration:none;color:#666;">关闭</a>
</div>
<div>
<a href="https://www.tj.msa.gov.cn/fzzfbmjs/index.jhtml/" target="_blank"><img src="/${res}/images/fzzfbmjs.jpg" alt="" title=""></a>
</div>
</div>
<script type="text/javascript">
var obj = document.getElementById("img1");
var ggRoll = {
roll: obj,
speed: 16,
statusX: document.documentElement.clientWidth - document.body.clientWidth,
statusY: document.documentElement.clientHeight - document.body.clientHeight,
x: 200,
y: 400,
winW: document.body.clientWidth - obj.offsetWidth * 2,
winH: document.body.clientHeight - obj.offsetHeight,
Go: function () {
this.roll.style.left = this.x + 'px';
this.roll.style.top = this.y + 'px';
this.x = this.x + (this.statusX ? -1 : 1);
if (this.x < 0) {
this.statusX = 0;
}
if (this.x > this.winW) {
this.statusX = 1;
}
this.y = this.y + (this.statusY ? -1 : 1);
if (this.y < 0) {
this.statusY = 0;
}
if (this.y > this.winH) {
this.statusY = 1;
}
}
}
var intervaly = setInterval("ggRoll.Go()", ggRoll.speed);
ggRoll.roll.onmouseover = function () {
clearInterval(intervaly);
};
ggRoll.roll.onmouseout = function () {
intervaly = setInterval("ggRoll.Go()", ggRoll.speed);
};
function closediv() {
clearInterval(intervaly);
obj.style.display = "none";
obj.parentNode.removeChild(obj);
}
</script>
<!---飘窗结束--->
img.style.left = xPos + scrollLeft +'px';
img.style.top = yPos + scrollTop +'px';
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);
}
start();
</script>
</body>
</html>nt.clientHeight || document.body.clientHeight;
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
scrollTop = document.documentElement.scrollLeft || document.body.scrollTop;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + scrollLeft +'px';
img.style.top = yPos + scrollTop +'px';
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);
}
start();
}
</style> |
|