模仿QQ播放器,歌曲名超出长度,文字自动左右滚动
来源:互联网 发布:滤波器算法 编辑:程序博客网 时间:2024/06/14 09:38
<!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>div+js实现首尾相连循环滚动效果</TITLE>
</HEAD>
<BODY>
<br /><br /><br /><br />
<DIV id="scrollobj" style="white-space:nowrap;overflow:hidden;width:100px;">只想一生跟你(粤)走-张学友</DIV>
<script language="javascript" type="text/javascript">
<!--
var flag = true;
var total = 0;
var timeFlag =0;
function scroll(obj) {
if(flag){
total = (obj.scrollLeft)++;
}
if (obj.scrollLeft==total){
flag = false;
clearInterval(timeFlag);
setTimeout(function(){
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
},2000);
}
if(0<=obj.scrollLeft<total){
if(!flag){
total = (obj.scrollLeft)--;
//alert(total+";"+obj.scrollLeft)
if(total==1){
flag = true;
total = 0;
obj.scrollLeft = 0;
clearInterval(timeFlag);
setTimeout(function(){
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
},2000);
}
}
}
}
clearInterval(timeFlag);
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
//-->
</script>
</BODY>
</HTML>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>div+js实现首尾相连循环滚动效果</TITLE>
</HEAD>
<BODY>
<br /><br /><br /><br />
<DIV id="scrollobj" style="white-space:nowrap;overflow:hidden;width:100px;">只想一生跟你(粤)走-张学友</DIV>
<script language="javascript" type="text/javascript">
<!--
var flag = true;
var total = 0;
var timeFlag =0;
function scroll(obj) {
if(flag){
total = (obj.scrollLeft)++;
}
if (obj.scrollLeft==total){
flag = false;
clearInterval(timeFlag);
setTimeout(function(){
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
},2000);
}
if(0<=obj.scrollLeft<total){
if(!flag){
total = (obj.scrollLeft)--;
//alert(total+";"+obj.scrollLeft)
if(total==1){
flag = true;
total = 0;
obj.scrollLeft = 0;
clearInterval(timeFlag);
setTimeout(function(){
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
},2000);
}
}
}
}
clearInterval(timeFlag);
timeFlag = setInterval("scroll(document.getElementById('scrollobj'))",35);
//-->
</script>
</BODY>
</HTML>
- 模仿QQ播放器,歌曲名超出长度,文字自动左右滚动
- 通过样式表超出长度的文字自动截取
- 文字左右滚动标签
- 文字左右无缝滚动
- 文字左右滚动代码
- 文字左右循环滚动
- jquery实现图片左右间隔滚动特效(可自动播放)
- jquery实现图片左右间隔滚动特效(可自动播放)
- TextField字数超出限制自动截取限制长度内的文字
- js特效--》文字左右滚动
- js实现文字左右滚动
- 文字超出部分自动省略
- QTextEdit/QPlainTextEdit添加文字超出视图后,滚动条自动移至最底部
- android 文字超出控件宽度时,自动滚动显示,类似跑马灯效果
- Android文字自动横向滚动的TextView(文字长度不够也可以)
- js设置图片或文字自动左右滚动控制,鼠标经过停留
- js设置图片或文字自动左右滚动控制,鼠标经过停留
- Android文字跑马灯控件(文本自动滚动控件,左右移动 带源码)
- 简易通讯录代码
- JDK+Eclipse+CDT+MinGW安装完全版
- EXTJS Odata 可能解决方案
- 最近的一点小总结
- IBM Rational Team Concert浅谈
- 模仿QQ播放器,歌曲名超出长度,文字自动左右滚动
- (翻译)二 MongoDB入门-作为windows服务运行
- (翻译)零 MongoDB入门-MongoDB简介
- Win CE下BSP中的bib文件学习
- poj-1050 题解
- windows下MongoDB入门
- wince 中的Dirs文件和Source文件
- (转载)四 MongoDB开发教程
- hdu2602