[JavaScript] 始终显示在网页右上角飘浮的图层文字特效 →→→→→进入此内容的聊天室

来自 , 2019-05-16, 写在 JavaScript, 查看 105 次.
URL http://www.code666.cn/view/0266e33d
  1. <textarea rows="8" id="CodeText83280" class="UBBText"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>无标题文档</title>
  6.  
  7. <style type="text/css">
  8. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
  9.      margin:0;
  10.      padding:0;
  11.  }
  12. .float {
  13.     background-color: #FFFEE0;
  14.     border: 1px solid #FFECB0;
  15.     box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  16.     padding: 10px;
  17.     position: absolute;
  18.     right: 10%;
  19.     top:134px;
  20.     width: 80px;
  21. }
  22. </style>
  23.  
  24. </head>
  25.  
  26. <body style="height:3000px;">
  27.  <div class="float" id="float">1c城市城</div>
  28. </div>
  29.  
  30. <script type="text/javascript">
  31. window.onscroll = function(){
  32.  setInterval(scrol,30);
  33. }
  34. function scrol(){
  35.  var oFd = document.getElementById('float');
  36.  var top = oFd.style.top;
  37.  var scrollTop = document.documentElement.scrollTop||document.body.scrollTop;
  38.  if(scrollTop > 134){
  39.   oFd.style.position = 'fixed';
  40.   oFd.style.top = '0';
  41.  }else{
  42.   oFd.style.position = 'absolute';
  43.   oFd.style.top = '134px';
  44.  }
  45. }
  46. </script>
  47. </body>
  48. </html>

回复 "始终显示在网页右上角飘浮的图层文字特效"

这儿你可以回复上面这条便签

captcha