怎样做一个类似于公交车报站时的电子屏幕的滚动字幕的效果?在线等
怎样做一个类似于公交车报站时的电子屏幕的滚动字幕的效果?
我想一个摸拟类似于公交车报站时的电子屏幕的滚动字幕的效果,滚动字幕不难实现,但是那种电子屏幕的那种字体效果比较难做到?请大家帮助!
------解决方案--------------------没弄过
给你个思路吧
在服务器上安装字体(电子屏幕的那种字体)然后类似于生成验证码,生成一个图片,然后将图片进行滚动
------解决方案--------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<div id="t1" class="info"><div id="t2" class="info"><a href='all/NoticeInfo.asp?id=14' target='frmright' class='red'>新办公平台使用须知 [2008-1-17]</a><br /><a href='all/NoticeInfo.asp?id=13' target='frmright' class='red'>关于填写工作日志的通知 [2008-1-3]</a><br /><a href='all/NoticeInfo.asp?id=11' target='frmright' class='red'>新系统开始使用 [2007-12-28]</a><br /><a href='all/NoticeInfo.asp?id=10' target='frmright' class='red'>办公平台V2.0测试版 [2007-12-27]</a><br /></div></div>
<script language="javascript">
<!--
marque(300,14,"t1","t2")
var scrollElem;
var stopscroll;
var stoptime;
var preTop;
var leftElem;
var currentTop;
var marqueesHeight;
function marque(width,height,marqueName,marqueCName){
try{
marqueesHeight = height;
stopscroll = false;
scrollElem = document.getElementById(marqueName);
with(scrollElem){
style.width = width;
style.height = marqueesHeight;
style.overflow = 'hidden';
noWrap = true;
}
scrollElem.onmouseover = new Function('stopscroll = true');
scrollElem.onmouseout = new Function('stopscroll = false');
preTop = 0;
currentTop = 0;
stoptime = 0;
leftElem = document.getElementById(marqueCName);
scrollElem.appendChild(leftElem.cloneNode(true));
init_srolltext();
}catch(e) {}
}
function init_srolltext(){
scrollElem.scrollTop = 0;
setInterval('scrollUp()', 20);
}
function scrollUp(){
if(stopscroll) return;
currentTop += 1;
if(currentTop == marqueesHeight+1) {
stoptime += 1;
currentTop -= 1;
if(stoptime == (marqueesHeight)*10) {//停顿时间
currentTop = 0;
stoptime = 0;
}
}else{
preTop = scrollElem.scrollTop;
scrollElem.scrollTop += 1;
if(preTop == scrollElem.scrollTop){
scrollElem.scrollTop = marqueesHeight;
scrollElem.scrollTop += 1;
}
}
}
//-->
</script>
</body>
</html>
------解决方案--------------------
1.做一个类似的背景公交车那个的效果!
2.使用 滤镜效果 中的mask (可参考这里 http://www0.ccidnet.com/school/web/2001/04/29/70_3998.html),或者自己搜索。
3.做滚动效果!
------解决方案--------------------不懂 帮顶