網頁漂浮
<div id="img" style="position:absolute; left:35px; top:556px; width:120; height:172">
<a href="/"qyml7.htm"> <img border="0" src="/"lo1.gif" width="140" height="120"></a></p>
</div>
<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);
}
start();
// End -->
</script>
② 求一個網頁漂浮圖片代碼
<script type="text/javascript">
function hidead()
{document.getElementById("ad").style.display="none";}
</script>
<div id="ad" style="position:absolute">
<a><a href="12.html"><img src="aa.jpg" border="0"></a>
</a>
<DIV onClick="hidead();" style="FONT-SIZE: 9pt; CURSOR: hand" align=right>關閉廣告×</DIV></div>
<p>
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 1
var obj=document.getElementById("ad")
function floatAD() {
var L=T=0
var R= document.body.clientWidth-obj.offsetWidth
var B = document.body.clientHeight-obj.offsetHeight
obj.style.left = x + document.body.scrollLeft
obj.style.top = y + document.body.scrollTop
x = x + step*(xin?1:-1)
if (x < L) { xin = true; x = L}
if (x > R){ xin = false; x = R}
y = y + step*(yin?1:-1)
if (y < T) { yin = true; y = T }
if (y > B) { yin = false; y = B }
}
var itl= setInterval("floatAD()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatAD()", delay)}
</script>
</p>
③ 網頁里的漂浮對話框怎麼做
示例: http://www.ijavascript.cn/tools/codedemo/jsad-code-float-right-221/demo1.htm 下載地址: http://www.ijavascript.cn/tools/codedemo/jsad-code-float-right-221/jsad-code-float-right-221.zip 把例子的窗口回改改就行答
④ 網頁漂浮廣告窗口怎麼做
應該是找網站,客服,合作
⑤ 網頁中的漂浮圖片怎麼鏈接到頁面
請注意看下
<SCRIPT language=javascript>
var imgheight
var imgright
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=310:imgheight=310
window.screen.width>800 ? imgright=window.screen.width-15-185:imgright=window.screen.width-120-120
function myRightload()
{
if (navigator.appName == "Netscape")
{document.myright.pageY=pageYOffset+window.innerHeight-imgheight;
document.myright.pageX=imgright;
rightmove();
}
else
{
myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myright.style.left=imgright;
rightmove();
}
}
function rightmove()
{
if(document.ns)
{
document.myright.top=pageYOffset+window.innerHeight-imgheight
document.myright.left=imgright;
setTimeout("rightmove();",80)
}
else
{
myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myright.style.left=imgright;
setTimeout("rightmove();",80)
}
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)
if (navigator.appName == "Netscape")
{
document.write("<layer id=myright style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'>");
document.write("");
document.write("<a href='http://www..com' target='_blank'><img src='image/piao.gif' quality=high border=0 WIDTH=100 HEIGHT=120 ></a>");
document.write("</layer>");
myRightload()}
else
{
document.write("<div id=myright style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'>");
document.write("");
document.write("<a href='http://www..com' target='_blank'><img src='image/piao.gif' quality=high border=0 WIDTH=100 HEIGHT=120 ></a>");
document.write("</div>");
myRightload()}
</SCRIPT>
我把這個鏈接到網路上去了,你只要改下超鏈接就可以了
⑥ 網頁上的漂浮物怎麼么做代碼是什麼要詳細的
第一步:建立JS內容:(請不要做任何修改) var xPos = 300; var yPos = 200; 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; img1.style.top = yPos; function changePos() { width = document.body.clientWidth; height = document.body.clientHeight; Hoffset = img1.offsetHeight; Woffset = img1.offsetWidth; img1.style.left = xPos + document.body.scrollLeft; img1.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() { img1.visibility = "visible"; interval = setInterval('changePos()', delay); } function pause_resume() { if(pause) { clearInterval(interval); pause = false;} else { interval = setInterval('changePos()',delay); pause = true; } } start(); 第二步:調用: <body> <DIV id=img1 style="Z-INDEX: 100; LEFT: 2px; WIDTH: 59px; POSITION: absolute; TOP: 43px; HEIGHT: 61px; visibility: visible;"><a href="http://www.05519.com/addmesg.asp" target="_blank"><img src="guanggao.gif" width="200" height="120" border="0"></a></DIV> <SCRIPT src="/js/隨意漂浮.js"></SCRIPT> </body>