参考
<script LANGUAGE='JavaScript'>
document.ns = navigator.appName == "Microsoft Internet Explorer"
function randomStr(str){
var showId=Math.floor(Math.random()*3);
var tempStr=str[showId];
str[showId]=str[0];
str[0]=tempStr;
}
function showStr(str,textWidth,num){
if(!document.ns){document.write(str[0]+'<br>')}
else{
document.write('<table border=0 cellspacing=0 cellpadding=0>'
+'<tr><td>'
+'<div id="icefable1'+num+'">'
+'<table width='+textWidth+' border=0 cellspacing=0 cellpadding=0>'
+'<tr><td height=20>'+str[0]+'</td></tr>'
+'<tr><td height=20>'+str[1]+'</td></tr>'
+'<tr><td height=20>'+str[2]+'</td></tr>'
+'</table>'
+'</div>'
+'<div id="icefable2'+num+'" style="position:absolute;z-index:1;visibility:hidden"></div>'
+'</td></tr>'
+'</table>');
}
}
function init_srolltext(num){
countnum=0
marqueesHeight=20;
eval('stopscroll'+num+'=false;')
eval('icefable1'+num+'.scrollTop=0;')
rotatenum=0
eval('icefable1'+num+'.style.width=0;')
eval('icefable1'+num+'.style.height=marqueesHeight;')
eval('icefable1'+num+'.style.overflowX="visible";')
eval('icefable1'+num+'.style.overflowY="hidden";')
eval('icefable1'+num+'.noWrap=true;')
eval('icefable1'+num+'.onmouseover=new Function("stopscroll=true");')
eval('icefable1'+num+'.onmouseout=new Function("stopscroll=false");')
eval('preTop'+num+'=0; ')
eval('currentTop'+num+'=0;')
eval('stoptime'+num+'=0;')
eval('icefable2'+num+'.innerHTML="";')
eval('icefable2'+num+'.innerHTML+=icefable1'+num+'.innerHTML;')
eval('icefable1'+num+'.innerHTML=icefable2'+num+'.innerHTML+icefable2'+num+'.innerHTML;')
eval('setInterval("scrollUp'+num+'()",40);')
}
function scrollUp1(){
if(stopscroll1==true) return;
currentTop1+=1;
if(currentTop1==21){
stoptime1+=1;
currentTop1-=1;
if(stoptime1==80){
currentTop1=0;
stoptime1=0;
}
}else{
preTop1=icefable11.scrollTop;
icefable11.scrollTop+=1;
if(icefable11.scrollTop==78){
preTop1=0; currentTop1=0; stoptime1=0;icefable11.scrollTop=0
}
}
}
var strArray1=new Array();
strArray1[0]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39854,65432,65473&cid=0,0,0&sid=62419&advid=2852&camid=9766&show=ignore&url=http://www.chengcai.net/zhaosheng/06kehu/0609renda/ target=_blank>人大—英澳加本科·硕士</a><'
strArray1[1]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39959,65558,65599&cid=0,0,0&sid=62540&advid=2855&camid=9794&show=ignore&url=http://www.bssc.org.cn/ target=_blank>北京高等秘书学院扩招!</a>'
strArray1[2]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39534,65054,65093&cid=0,0,0&sid=62077&advid=2618&camid=9705&show=ignore&url=http://www.topxue.com/web/lcm/bjdx/eco.html target=_blank>北大总裁EMBA班本周开学</a>'
randomStr(strArray1);
showStr(strArray1,140,1);
init_srolltext(1);
</script>
<script LANGUAGE='JavaScript'>
document.ns = navigator.appName == "Microsoft Internet Explorer"
function randomStr(str){
var showId=Math.floor(Math.random()*3);
var tempStr=str[showId];
str[showId]=str[0];
str[0]=tempStr;
}
function showStr(str,textWidth,num){
if(!document.ns){document.write(str[0]+'<br>')}
else{
document.write('<table border=0 cellspacing=0 cellpadding=0>'
+'<tr><td>'
+'<div id="icefable1'+num+'">'
+'<table width='+textWidth+' border=0 cellspacing=0 cellpadding=0>'
+'<tr><td height=20>'+str[0]+'</td></tr>'
+'<tr><td height=20>'+str[1]+'</td></tr>'
+'<tr><td height=20>'+str[2]+'</td></tr>'
+'</table>'
+'</div>'
+'<div id="icefable2'+num+'" style="position:absolute;z-index:1;visibility:hidden"></div>'
+'</td></tr>'
+'</table>');
}
}
function init_srolltext(num){
countnum=0
marqueesHeight=20;
eval('stopscroll'+num+'=false;')
eval('icefable1'+num+'.scrollTop=0;')
rotatenum=0
eval('icefable1'+num+'.style.width=0;')
eval('icefable1'+num+'.style.height=marqueesHeight;')
eval('icefable1'+num+'.style.overflowX="visible";')
eval('icefable1'+num+'.style.overflowY="hidden";')
eval('icefable1'+num+'.noWrap=true;')
eval('icefable1'+num+'.onmouseover=new Function("stopscroll=true");')
eval('icefable1'+num+'.onmouseout=new Function("stopscroll=false");')
eval('preTop'+num+'=0; ')
eval('currentTop'+num+'=0;')
eval('stoptime'+num+'=0;')
eval('icefable2'+num+'.innerHTML="";')
eval('icefable2'+num+'.innerHTML+=icefable1'+num+'.innerHTML;')
eval('icefable1'+num+'.innerHTML=icefable2'+num+'.innerHTML+icefable2'+num+'.innerHTML;')
eval('setInterval("scrollUp'+num+'()",40);')
}
function scrollUp1(){
if(stopscroll1==true) return;
currentTop1+=1;
if(currentTop1==21){
stoptime1+=1;
currentTop1-=1;
if(stoptime1==80){
currentTop1=0;
stoptime1=0;
}
}else{
preTop1=icefable11.scrollTop;
icefable11.scrollTop+=1;
if(icefable11.scrollTop==78){
preTop1=0; currentTop1=0; stoptime1=0;icefable11.scrollTop=0
}
}
}
var strArray1=new Array();
strArray1[0]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39854,65432,65473&cid=0,0,0&sid=62419&advid=2852&camid=9766&show=ignore&url=http://www.chengcai.net/zhaosheng/06kehu/0609renda/ target=_blank>人大—英澳加本科·硕士</a><'
strArray1[1]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39959,65558,65599&cid=0,0,0&sid=62540&advid=2855&camid=9794&show=ignore&url=http://www.bssc.org.cn/ target=_blank>北京高等秘书学院扩招!</a>'
strArray1[2]='<a href=http://sina.allyes.com/main/adfclick?db=sina&bid=39534,65054,65093&cid=0,0,0&sid=62077&advid=2618&camid=9705&show=ignore&url=http://www.topxue.com/web/lcm/bjdx/eco.html target=_blank>北大总裁EMBA班本周开学</a>'
randomStr(strArray1);
showStr(strArray1,140,1);
init_srolltext(1);
</script>
解决方案 »
- ie下访问同域下的iframe被拒绝
- 求:用js正则表达式判断输入的是否为整数,谁给详解所用的正则表达式?
- 在 JavaScript 中说明指定事件处理程序
- (在线等)页面onload()事件时,自动点击页面的button
- 请问怎么得到隐藏列的innerText值
- 高分求Email地址的正则表达式验证,最好有比较完整的JS。(在线等)
- 怎么通过父窗口调用子窗口的函数
- 一個很有挑戰的問題 ﹗﹗﹗--> text + select
- 用什么方法来控制用户在表单里面只能输入数字
- 怎么把javascript的变量值赋给jsp
- 【請問,我想在JavaScript 裏面用 Transfer】
- 求救,各位救救我吧!!!
* { font-size:10pt; }
</style>
<div id="so1">
<a href="announcement.php?id=8#8"><span class="bold">公会网站P2P电视栏目为大家准备了“世界杯大餐”!</span> (2006-6-3)</a><br> <a href="announcement.php?id=6#6"><span class="bold"><font color=red>公会论坛注册需要邮箱认证! </color></span> (2006-4-21)</a><br> <a href="announcement.php?id=3#3"><span class="bold">公会QQ1群:6410747(已满) QQ2群:6712951</span> (2006-2-12)</a><br> </div><div id='so2' style='position:absolute;z-index:1;visibility:hidden'></div>
<script>
marqueesHeight=16;
stopscroll=false;
document.all.so1.scrollTop=0;
with(so1){
style.width=776;
style.height=marqueesHeight;
style.overflowX='visible';
style.overflowY='hidden';
noWrap=true;
onmouseover=new Function('stopscroll=true');
onmouseout=new Function('stopscroll=false');
}
preTop=0; currentTop=0; stoptime=0;
function init_srolltext(){
document.all.so2.innerHTML='';
document.all.so2.innerHTML+=document.all.so1.innerHTML;
document.all.so1.innerHTML=document.all.so2.innerHTML+document.all.so2.innerHTML;
setInterval('scrollUp()',1);
}
function scrollUp(){
if(stopscroll==true) return;
currentTop+=1;
if(currentTop==16)
{
stoptime+=1;
currentTop-=1;
if(stoptime==200)
{
currentTop=0;
stoptime=0;
}
}
else {
preTop=document.all.so1.scrollTop;
document.all.so1.scrollTop+=1;
if(preTop==document.all.so1.scrollTop){
document.all.so1.scrollTop=document.all.so2.offsetHeight-marqueesHeight;
document.all.so1.scrollTop+=1;
}
}
}
setTimeout('init_srolltext()', 3000)
</script>