中文(繁体)
網頁特效代碼,按一定時間向上滾動的文字訊息,可以當做網站公告!或其它別的新聞等! !時間可以自己設定。
<html> <title>按一定時間向上捲動的文字訊息! downcodes.com</title> <style type="text/css"> <!-- /*頂部滾動秀*/ #scrolllayer {float:left;overflow:hidden;height:18px;background:#E0E0E0;padding: 0px;width:180px; margin-top:3px;} #scrollmessage {float:left;text-align:left;width:180px;font-size:12px;font-family: "宋體";} #scrolllistsage ul { -style:none; padding:0; margin:0;} #scrollmessage li {line-height:18px;color:#FF0000;} #scrollmessage li a{color:#FF0000; text-decoration:none;} --> </style> </head> <body> <div id="scrolllayer"> <div id="scrollmessage"> <ul> <li><a href="http://www.downcodes.com" target= "_blank" title="[上海電影節] 跟女明星學扮靚之道">上海電影節女明星</a></li> <li><a href="http://www.downcodes. com" target="_blank" title="20款簡約北歐風格經典樣品房">20款簡約北歐風格經典樣品屋</a></li> <li><a href="http://www. downcodes.com" target="_blank" title="天生明星臉的天使們">天生明星臉的天使們! </a></li> <li><a href="http://www.downcodes.com" target="_blank" title="多吃四種食物防曬更有效率">多吃四種食物防曬更有效率</a></li> <li><a href="http://www.downcodes.com" target="_blank" title="該給妝容換夏裝啦!">臉蛋也要換“夏妝」</a></li> </ul> </div> </div> <script type="text/javascript" language="javascript"> <!-- //以下參數請勿修改try { var marqueesHeight = 18; //高度var stopscroll = false; var scrollElem = document.getElementById("scrolllayer"); with(scrollElem){ style.width = 180;//寬度style.height = marqueesHeight style.width = 180;//寬度style.height = marqueesHeight style. 'hidden'; noWrap = true; } scrollElem.onmouseover = new Function('stopscroll = true'); scrollElem.onmouseout = new Function('stopscroll = false'); var preTop = 0; var currentTop = 0; 0; var leftElem = document.getElementById("scrollmessage"); scrollElem.appendChild(leftElem.cloneNode(true)); init_srolltext(); }catch(e) {} function init_srolltext(Interscroll(Interscroll; 'scrollUp()', 15); //捲動速度} function scrollUp(){ if(stopscroll) return; currentTop += 1; if(currentTop == 19) { //滾動距離stoptime += 1; currentTop -= 1; if(stoptime == 220) { //停頓時間currentTop = 0; stoptime = 0; } }else{ preTop = scrollElem.scrollTop; scrollElem.scrollTop += 1; if(preTop == scrollElem.scrollTop) .scrollTop = 0; scrollElem.scrollTop += 1; } } } //--> </script> </body> </html>