javascript如何实现新闻滚动效果?
末日的春天
末日的春天 2017-03-01 09:52:49
[JavaScript讨论组]

javascript如何实现新闻滚动效果?

末日的春天
末日的春天

全部回复(2)
数据分析师

javascript如何实现新闻滚动效果?-PHP中文网问答-javascript如何实现新闻滚动效果?-PHP中文网问答

围观一下哦,学习一下。

伊谢尔伦
<!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> 
<title>code.js.cn </title> 
<style> 
a 
{ 
display: block; 
font-size: 15px; 
line-height: 18px; 
text-decoration: none; 
color: #333; 
font-family: Arial; 
font-size: 12px; 
} 
.shell 
{ 
background:no-repeat 4px 5px; 
border: 1px solid #aaa; 
width: 400px; 
padding: 3px 2px 2px 20px; 
} 
#p1 
{ 
height: 36px; 
overflow: hidden; 
} 
</style> 
</head> 
<body> 
<p class="shell"> 
<p id="p1"> 
<a>这是</a> 
<a>我的</a> 
<a>第一篇</a> 
<a>博客</a> 
</p> 
</p> 
</body> 
<script> 
var c, _ = Function; 
with (o = document.getElementById("p1")) { innerHTML += innerHTML; onmouseover = _("c=1"); onmouseout = _("c=0"); } 
(F = _("if(#%18||!c)#++,#%=o.scrollHeight>>1;setTimeout(F,#%18?10:3000);".replace(/#/g, "o.scrollTop")))(); 
</script> 
</html>

滚动频率由setTimeout(F,#%18?10:3000)这个3000来控制。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号