JS漂浮广告,在本地可以跑,放到服务器上就不动了 90
首页e-greentest.com,要有个漂浮效果代码如下:<includefile="Public:header"/><!--图片漂浮广告代码开始--><divid="...
首页e-greentest.com,要有个漂浮效果
代码如下:
<include file="Public:header"/>
<!--图片漂浮广告代码开始-->
<div id="Greentest" style="position:absolute;z-index:999;">
<!--链接地址--><a href="http://e-greentest.com/index.php/news_v_6_40.html/?t=defalut&l=zh-us"
_fcksavedurl="/" target="_blank">
<!--图片地址--><img src="__PUBLIC__/en/images/travel_ad.jpg"
_fcksavedurl="__PUBLIC__/en/images/travel_ad.jpg" border="0">
</a>
</div>
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getElementById("Greentest")
function floatGreentest() {
var L=T=0
//by www.qpsh.com
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("floatGreentest()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatGreentest()", delay)}
</script>
<!--图片漂浮广告代码结束-->
<div class="box1 rel">
<div class="wp">
<div class="news1">
<ul class="c">
<artlist cid="6" row="3" flag="c">
<li><a href="{$field.url}"><span>{$field.addtime}</span>{$field.article_title_en|cms_substr=25}</a></li>
</artlist>
</ul>
...
<include file="Public:footer"/> 展开
代码如下:
<include file="Public:header"/>
<!--图片漂浮广告代码开始-->
<div id="Greentest" style="position:absolute;z-index:999;">
<!--链接地址--><a href="http://e-greentest.com/index.php/news_v_6_40.html/?t=defalut&l=zh-us"
_fcksavedurl="/" target="_blank">
<!--图片地址--><img src="__PUBLIC__/en/images/travel_ad.jpg"
_fcksavedurl="__PUBLIC__/en/images/travel_ad.jpg" border="0">
</a>
</div>
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getElementById("Greentest")
function floatGreentest() {
var L=T=0
//by www.qpsh.com
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("floatGreentest()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatGreentest()", delay)}
</script>
<!--图片漂浮广告代码结束-->
<div class="box1 rel">
<div class="wp">
<div class="news1">
<ul class="c">
<artlist cid="6" row="3" flag="c">
<li><a href="{$field.url}"><span>{$field.addtime}</span>{$field.article_title_en|cms_substr=25}</a></li>
</artlist>
</ul>
...
<include file="Public:footer"/> 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏90(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询