隨筆-179  評論-666  文章-29  trackbacks-0

          ?

          < head >
          < meta? http-equiv ="Content-Type" ?content ="text/html;?charset=utf-8" ? />
          < title > Untitled?Document </ title >
          < script? language ="javascript" ?type ="text/javascript" >
          <!--
          /* ****************************** */
          /* ????????文字自動循環滾動???????? */
          /* ????????Power?by?Todd?Lee???????? */
          /* ????????lijiantao@eyou.com???????? */
          /* ????????www.todd-lee.com???????? */
          /* ????????IE6?FF1.0.4???????????????? */
          /* ????????不支持xhtml聲明的文檔???? */
          /* ????????2005-05-24?v1.0???????????? */
          /* ****************************** */

          // *********不要修改這部分***************
          //
          scrollBodyId:????String?內部滾動div的id
          //
          scrollBoxId:????String?外面限制div的id
          //
          showHeight:????Int?限制顯示高度
          //
          showWidth:????Int?限制顯示寬度
          //
          lineHeight:????Int?每行的高度
          //
          stopTime:????????Int?間隔停止的時間(毫秒)
          //
          speed:????????Int?滾動速度(毫秒,越小越快)
          var ?ScrollObj? = ? function (scrollBodyId,scrollBoxId,showHeight,showWidth,lineHeight,stopTime,speed)? {
          ????
          this .obj? = ?document.getElementById(scrollBodyId);
          ????
          this .box? = ?document.getElementById(scrollBoxId);
          ????
          ????
          this .style? = ? this .obj.style;
          ????
          this .defaultHeight? = ? this .obj.offsetHeight;
          ????
          ????
          this .obj.innerHTML? += ? this .obj.innerHTML;
          ????
          this .obj.style.position? = ? " relative " ;
          ????
          ????
          this .box.style.height? = ?showHeight;
          ????
          this .box.style.width? = ?showWidth;
          ????
          this .box.style.overflow? = ? " hidden " ;
          ????
          ????
          this .scrollUp? = ?doScrollUp;

          ????
          this .stopScroll? = ? false ;
          ????
          ????
          this .curLineHeight? = ? 0 ;
          ????
          this .lineHeight? = ?lineHeight;
          ????
          this .curStopTime? = ? 0 ;
          ????
          this .stopTime? = ?stopTime;
          ????
          this .speed? = ?speed;

          ????
          this .style.top? = ?lineHeight;

          ????
          this .object? = ?scrollBodyId? + ? " Object " ;
          ????eval(
          this .object? + ? " =this " );
          ????setInterval(
          this .object + " .scrollUp() " ,speed);
          ????
          this .obj.onmouseover = new ?Function( this .object + " .stopScroll=true " );
          ????
          this .obj.onmouseout = new ?Function( this .object + " .stopScroll=false " );
          }

          function ?doScrollUp() {
          ????
          if (? this .stopScroll? == ? true ?)
          ????????
          return ;
          ??????
          this .curLineHeight? += ? 1 ;
          ??????
          if (? this .curLineHeight? >= ? this .lineHeight?) {
          ??????????
          this .curStopTime? += ? 1 ;
          ??????????
          if (? this .curStopTime? >= ? this .stopTime?) {
          ??????????????
          this .curLineHeight? = ? 0 ;
          ??????????????
          this .curStopTime? = ? 0 ;
          ??????????}

          ??????}

          ????
          else {??????
          ??????????
          this .style.top? = ?parseInt( this .style.top)? - ? 1 ;
          ??????????
          if (? - parseInt( this .style.top)? >= ? this .defaultHeight?) {
          ????????????
          this .style.top? = ? 0 ;
          ??????????}

          ??????}

          }

          // ***************這以上不要修改******************
          //
          -->
          </ script >
          </ head >

          < body >
          < div? id ="scroollBox" ?style ="border:1px?solid?red;?" >
          < div? id ="scroollBody" >
          ????這里是一些提示信息
          < br >
          ????他可以自動向上循環的滾動
          < br >
          ????每滾動一行,就會停下來休息一會
          < br >
          ????當鼠標經過他的時候,他停止滾動
          < br >
          ????當鼠標離開時,他繼續滾動
          < br >
          </ div >
          </ div >
          < script? language ="javascript" ?type ="text/javascript" >
          <!-- ?
          var ?sample? = ? new ?ScrollObj( " scroollBody " , " scroollBox " , 25 , 300 , 19 , 63 , 50 );
          // ?-->
          </ script >
          </ body >
          </ html >
          posted on 2006-10-18 11:03 Alpha 閱讀(6469) 評論(0)  編輯  收藏 所屬分類: JavaScript
          主站蜘蛛池模板: 旬阳县| 东乡县| 牟定县| 锦州市| 巴彦淖尔市| 溧水县| 仲巴县| 安新县| 洛浦县| 六枝特区| 邛崃市| 来凤县| 阳曲县| 永登县| 响水县| 博白县| 同仁县| 虎林市| 利川市| 阳新县| 江川县| 肃北| 宁波市| 巴彦县| 诏安县| 滨海县| 南涧| 富锦市| 深水埗区| 宝山区| 于田县| 巴青县| 汉寿县| 冀州市| 汉中市| 绵阳市| 普兰店市| 凤台县| 中卫市| 万安县| 旬阳县|