- 註冊時間
- 2002-6-5
- 線上時間
- 3007 小時
- 閱讀權限
- 200
- 積分
- 2509
- 主題
- 181
- 精華
- 5
- 文章
- 2201
TA的每日心情 | 郁悶 2013-4-6 01:41 |
---|
簽到天數: 4 天 連續簽到: 1 天 [LV.2]偶爾看看I - 文章
- 2201
|
本文最後由 小賤健 於 2009-7-22 19:58 編輯
我來雞婆一下好了
- <div id="ann" onmouseover="annstop = 1" onmouseout="annstop = 0">
- <dl>
- <dt>公告</dt>
- <dd>
- <div id="annbody"><ul id="annbodylis"><li><a href="announcement.php?id=3">Share life with you 與你分享生活,PALMisLIFE 討論區改版中<em>(2007-4-8)</em></a></li><li><a href="announcement.php?id=4">討論區分區調整,新增 [保險與投資]、[保養與化妝]、[交通工具] 三討論區<em>(2007-4-9)</em></a></li></ul></div>
- </dd>
- </dl>
- </div>
- <script type="text/javascript">
- var anndelay = 3000;
- var annst = 0;
- var annstop = 0;
- var annrowcount = 0;
- var anncount = 0;
- var annlis = $('annbody').getElementsByTagName("LI");
- var annrows = new Array();
- var annstatus;
- function announcementScroll() {
- if(annstop) {
- annst = setTimeout('announcementScroll()', anndelay);
- return;
- }
- if(!annst) {
- var lasttop = -1;
- for(i = 0;i < annlis.length;i++) {
- if(lasttop != annlis[i].offsetTop) {
- if(lasttop == -1) {
- lasttop = 0;
- }
- annrows[annrowcount] = annlis[i].offsetTop - lasttop;
- annrowcount++;
- }
- lasttop = annlis[i].offsetTop;
- }
- if(annrows.length == 1) {
- $('ann').onmouseover = $('ann').onmouseout = null;
- } else {
- annrows[annrowcount] = annrows[1];
- $('annbodylis').innerHTML += $('annbodylis').innerHTML;
- annst = setTimeout('announcementScroll()', anndelay);
- }
- annrowcount = 1;
- return;
- }
- if(annrowcount >= annrows.length) {
- $('annbody').scrollTop = 0;
- annrowcount = 1;
- annst = setTimeout('announcementScroll()', anndelay);
- } else {
- anncount = 0;
- announcementScrollnext(annrows[annrowcount]);
- }
- }
- function announcementScrollnext(time) {
- $('annbody').scrollTop++;
- anncount++;
- if(anncount != time) {
- annst = setTimeout('announcementScrollnext(' + time + ')', 10);
- } else {
- annrowcount++;
- annst = setTimeout('announcementScroll()', anndelay);
- }
- }
- </script>
- </div>
複製代碼 PS: 上頭的 javascript 要先引用 jQuery 才可以動。 |
|