隔几秒滚动一下的文字新闻效果
来源:互联网 发布:数据魔镜 编辑:程序博客网 时间:2024/06/08 12:53
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script> var marqueeContent=new Array(); //滚动新闻
marqueeContent[0]='<font color="#0000CC">14:25 </font><a href=http://www.blueidea.com/updatelist.asp target=_blank class="f12red">如果有回复则通过电子邮件提醒。只有注册用户才有此功能</a><br>';
marqueeContent[1]='<font color="#0000CC">14:25 </font><a href=http://www.blueidea.com/updatelist.asp target=_blank class="f12red">如果您的帖子中有转帖代码请筛选复选此项</a><br>';
marqueeContent[2]='<font color="#0000CC">14:25 </font><a href=http://www.blueidea.com/updatelist.asp target=_blank class="f12red">包含您在户口本中的签名只有注册用户有此功能</a><br>';
var marqueeInterval=new Array(); //定义一些常用而且要经常用到的变量
var marqueeId=0;
var marqueeDelay=4000;
var marqueeHeight=20;
//接下来的是定义一些要使用到的函数
function initMarquee() {
var str=marqueeContent[0];
document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(/'startMarquee()/',marqueeDelay)"><div>'+str+'</div></div>');
marqueeId++;
marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
var str=marqueeContent[marqueeId];
marqueeId++;
if(marqueeId>=marqueeContent.length) marqueeId=0;
if(marqueeBox.childNodes.length==1) {
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
marqueeBox.appendChild(nextLine);
}
else {
marqueeBox.childNodes[0].innerHTML=str;
marqueeBox.appendChild(marqueeBox.childNodes[0]);
marqueeBox.scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
marqueeBox.scrollTop++;
if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();
</script>
- 隔几秒滚动一下的文字新闻效果
- JavaScrpt文字滚动的效果
- 标题栏的文字滚动效果
- 文字上下滚动的效果
- 从下往上的新闻滚动效果
- ASP类似新闻滚动效果的示例
- 模拟网易新闻主页的滚动效果
- Android 上下滚动的新闻效果
- 逐行新闻滚动效果
- 逐行新闻滚动效果
- jQuery模拟百度新闻不间断滚动效果,支持文字、图片水平垂直滚动
- IE8的滚动文字图片效果
- 横向不间断的文字滚动效果
- FLEX3的图片文字滚动效果
- jquery实现文字的上下滚动效果
- 可控的文字列表上下滚动效果
- iOS文字上下滚动效果的实现
- 实现上下文字滚动的效果
- Serial library for C++. Free source code and programming help
- 字节对齐详解
- 雅虎公司C#笔试题
- 从今天起大量转载文章
- 小问题合集
- 隔几秒滚动一下的文字新闻效果
- Performance 调试还是挺有意思的!
- 改变现状
- css的表格颜色切换
- 无限连动下拉菜单
- JavaScript使用技巧精萃
- SQL Server 连接基础知识
- 我的理想
- C# 编码规范和编程好习惯