Roy_Cao

Html 及 JS 代码如下:

<div id="newsOne" onmouseover="CleartTimeInterVal();" onmouseout="resetInterVal();"
       style="position: absolute; width: 100px;">
       <a href="http://www.baidu.com" target="_blank">test Div</a>
   </div>
   <script type=\'text/javascript\'>

       var newsOne = document.getElementById("newsOne");

       newsOne.style.bottom = 0;
       newsOne.style.left = window.screen.availWidth - 100;
       var bottom = 0;
       function newsScroll() {
           if (bottom > (window.screen.availHeight - window.screenTop)) {
                       bottom = 0;
               newsOne.style.bottom = 0;

           }
           else {

               bottom = bottom + 15;
               newsOne.style.bottom = bottom;
           }

       }


       var timeid = setInterval(newsScroll, 300);

       function CleartTimeInterVal() {
           clearInterval(timeid);
       }
       function resetInterVal() {
           timeid = setInterval(newsScroll, 300);
       }


   </script>

分类:

技术点:

相关文章:

  • 2022-01-07
  • 2021-11-21
  • 2021-11-17
  • 2021-10-19
  • 2022-01-07
  • 2022-01-17
猜你喜欢
  • 2022-01-01
  • 2021-11-02
  • 2021-10-19
  • 2021-12-19
  • 2021-08-06
相关资源
相似解决方案