手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js新闻滚动 js如何实现新闻滚动效果
js新闻滚动 js如何实现新闻滚动效果
摘要:具体代码如下:复制代码代码如下:code.js.cna{display:block;font-size:15px;line-height: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>

<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;

}

#div1

{

height: 36px;

overflow: hidden;

}

</style>

</head>

<body>

<div>

<div id="div1">

<a>这是</a>

<a>我的</a>

<a>第一篇</a>

<a>博客</a>

</div>

</div>

</body>

<script>

var c, _ = Function;

with (o = document.getElementById("div1")) { 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来控制。

【js新闻滚动 js如何实现新闻滚动效果】相关文章:

滚动效果

新闻一段时间向上滚动效果

jQuery实现在列表的首行添加数据

jquery实现弹出层效果实例

js控制div弹出层实现方法

Jquery注册事件实现方法

js实现带按钮的上下滚动效果

js实现顶部可折叠的菜单工具栏效果实例

jQuery结合ajax实现动态加载文本内容

javascript搜索框效果实现方法

精品推荐
分类导航