参考:
http://www.360doc.com/content/14/1210/17/9060464_431831883.shtml
例子:
<table width="100%" border="0px" cellpadding="0" cellspacing="0" style="font-family:微软雅黑;font-size:21px;line-height:30px;color:#FF7A32;">
<tr>
<td height="40px" onclick="BackHome();return false;" width="30px" align="left" valign="middle" style="cursor:pointer;">
<a href="#" ><img src="public/images/computer/mobile/fanhui.png" style="height:20px;"/></a>
</td>
<td align="left">
<span style="color:#000000;display:block;overflow:hidden;height:30px;" onclick="Addmarquee_cont($(this));return false;">{$un_title}</span>
</td>
<td width="5px">
</td>
<td align="center" valign="middle" width="65px" >
<span id="" style="font-size:25px;color:green;">0</span>/<span id="" style="color:#000000;">0</span>
</td>
<td align="right" valign="middle" style="display:none;">
<table cellspacing="0" cellspacing="0" align="right">
<tr>
<td height="50px" valign="middle" style="padding-right:5px;">
<img src="public/images/computer/mobile/time.png" style="height:25px;width:25px;"/>
</td>
<td valign="middle">
<span id="" style="font-size:20px;line-height:30px;">0:0:0</span>
</td>
</tr>
</table>
</td>
<!--{if !$in_tuiguang_tiyan}-->
<td align="center" valign="middle" width="70px" id="lewendy_button_outer">
<a href="#" onclick="MbFrame.AskTeacher();return false;" style="width:70px !important;border:1px solid red;"><span id="" style="color:#FF7A32;font-family: 微软雅黑;">答疑</span></a>
</td>
<!--{/if}-->
<td align="right" valign="middle" width="35px" id="menu_button_outer">
<a href="#" onclick="ShowHideToolBar(); return false;"><img src="public/images/computer/mobile/caidan.png" style="width:25px;"/></a>
</td>
</tr>
</table>
js
// 做题单元跑马灯 点击停止与运行 obj marquee跑马灯对象 id
TopBarTitleMarquee: function (obj, id){
var flog = $('#'+id).attr('data');
if(flog == 0){ // 停止
obj.stop();
flog = 1;
}else{ // 开始
obj.start();
flog = 0;
}
$('#'+id).attr('data',flog);
},
// 添加跑马灯
Addmarquee_cont : function(obj){
if(Marquee) return false;
var cont = obj.html();
var width = obj.width();
var html = '<marquee width='+width+' onclick="TopBarTitleMarquee(this,\'top_bar_title_marquee\');return false;" id="top_bar_title_marquee" behavior="scroll" data="0">';
var html2 = '</marquee>';
obj.html(html+cont+html2);
Marquee = true;
},