Home  >  Article  >  Web Front-end  >  Collection of codes suitable for bulletin boards_Typical special effects

Collection of codes suitable for bulletin boards_Typical special effects

WBOY
WBOYOriginal
2016-05-16 19:19:391286browse
1. Each text message is displayed in a loop,

[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]



2. Display text line by line, with fading and fading effects during the conversion process



[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]


3. Each news information appears in turn by typing

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
 


4.滚轴式向上滚动文字,每次只显示一行 


' +'' +''); marqueesHeight=21; stopscroll=false; toptable.scrollTop=0; with(toptable){ style.width=0; style.height=marqueesHeight; style.overflowX="visible"; style.overflowY="hidden"; noWrap=true; onmouseover=new Function("stopscroll=true"); onmouseout=new Function("stopscroll=false"); } preTop=0; currentTop=21; stoptime=0; toptable.innerHTML+=toptable.innerHTML; function init_srolltext(){ toptable.scrollTop=0; setInterval("scrollUp()",40); }init_srolltext(); function scrollUp(){ if(stopscroll==true) return; currentTop+=1; if(currentTop==22) { stoptime+=1; currentTop-=1; if(stoptime==80) { currentTop=0; stoptime=0; } } else { preTop=toptable.scrollTop; toptable.scrollTop+=1; if(preTop==toptable.scrollTop){ toptable.scrollTop=42; toptable.scrollTop+=1; } } }
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行


5.文字信息一条接一条显示 


') if (window.addEventListener) window.addEventListener("load", beginticker, false) else if (window.attachEvent) window.attachEvent("onload", beginticker) else if (document.all || document.getElementById) window.onload=beginticker
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行


6.加亮卷动是在视觉上引起兴趣,多次卷动。 它逐渐地将每个信息进从底部升到顶端的视线中,是显示文本的一种好方法。  

') var currentmessage=0 var clipbottom=1 function changetickercontent(){ msgheight=clipbottom=crosstick.offsetHeight crosstick.style.clip="rect("+msgheight+"px auto auto 0px)" crosstickbg.innerHTML=tickercontents[currentmessage] crosstick.innerHTML=tickercontents[currentmessage] highlightmsg() } function highlightmsg(){ //var msgheight=crosstick.offsetHeight if (clipbottom>0){ clipbottom-=highlightspeed crosstick.style.clip="rect("+clipbottom+"px auto auto 0px)" beginclip=setTimeout("highlightmsg()",20) } else{ clipbottom=msgheight clearTimeout(beginclip) if (currentmessage==tickercontents.length-1) currentmessage=0 else currentmessage++ setTimeout("changetickercontent()",tickdelay) } } function start_ticking(){ crosstickbg=document.getElementById? document.getElementById("highlighterbg") : document.all.highlighterbg crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement if (parseInt(crosstick.offsetHeight)>0) crosstickParent.style.height=crosstick.offsetHeight+'px' else setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) //delay for Mozilla's sake changetickercontent() } if (document.all || document.getElementById) window.onload=start_ticking
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行


7.可以一条一条的显示文字,也可以点击展开全部文字



visibility=hide>




7.在文字转换间加上了类似灯光遮照的效果

以下代码加入区域<SCRIPT> <br><!-- <BR>function correct(){ <BR>if (finished){ <BR>setTimeout("begin()",3000) <BR>} <BR>return true <BR>} <BR>window.onerror=correct <BR>function begin(){ <BR>if (!document.all) <BR>return <BR>if (maxheight==null) <BR>maxheight=temp.offsetHeight <BR>whatsnew.style.height=maxheight <BR>temp.style.display="none" <BR>c=1 <BR>finished=true <BR>change() <BR>} <BR>//--> <br></SCRIPT>以下代码加入区域bgcolor=#000000 border=0 align="center">
 
 



 
 


id=temp style="LEFT: 0px; POSITION: absolute; TOP: 0px"> 
  





8.文字一段一段的显示,每次交换时都带有渐隐渐显的效果 


[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn