求一段左下角漂浮的JS广告代码?可以随窗口上下滚动的,要JS的。

JavaScript018

求一段左下角漂浮的JS广告代码?可以随窗口上下滚动的,要JS的。,第1张

复制粘贴我的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<style>

*{margin:0}

body{

height:1000px

width:1000px

}

#a{

width:300px

height:100px

background:red

}

</style>

<script>

var isie6 = window.XMLHttpRequest?false:true

window.onload = function(){

var a = document.getElementById('a')

var d = document.getElementById('d')

if(isie6){

a.style.position = 'absolute'

window.onscroll = function(){

d.innerHTML = ''

}

}else{

a.style.position = 'fixed'

}

a.style.left= '0'

a.style.bottom = '0'

}

</script>

</head>

<body>

<div id ="d" style="display:none">rgrrrrrrrr</div>

<div id='a'>test</div>

</body>

</html>

若是效果不是你想要的,我还可以给你写,到你满意为止。

只是用的话简单,你上面贴的都是 JavaScript 脚本代码。因为现在做网站不管大小,都会用到几个技术:HTML做网页结构(就是表面东西),CSS做外观(就是字体颜色什么的),JavaScript做交互动作(就是点击弹出个窗口漂浮广告什么的)。

你要用的网页特效其实就是各种 JavaScript 脚本代码,就像你贴出来的这样的。你上那些网页特效网站,上面应该都注明了代码该如何用的,其实一般就是:把 <script>...</script>复制到 <head>和 </head>的里面或者是<body>和</body>里面就行了,具体复制到哪?试试就行,这处不行换一处。呵呵...

那是因为changepos函数里面没有interval这个指针

所以应该改成onmouseout=function(){start()}

就ok了

大过年的,你还这么专心啊 ?