主题 : 执行后,提示标签错误是什么原因?
级别: 秀才
UID: 94566
积分:83 加为好友
威望: 2 精华: 0
主题:7 回复:25
注册时间:2016-11-18
在线时长:0
1#   发表于:2021-03-29 12:05:38  IP:111.247.*.*
<!---飘窗开始--->
   
 <div id="img1" style="z-index: 999; border: 1px solid rgb(204, 204, 204); width: 340px; background-color: white; height: 150px; position: absolute; top: 175px; left: 25px; font-size: 13px;" >
 
           <div style="height:18px;margin-left:310px;margin-top:6px;">
  
              <a href="javascript:void(0);" onclick="closediv()" title="点击关闭" style="height:16px;text-decoration:none;color:#666;">关闭</a>
    
        </div>
          
  <div>
               
 <a href="https://www.tj.msa.gov.cn/fzzfbmjs/index.jhtml/" target="_blank"><img src="/${res}/images/fzzfbmjs.jpg"  alt="" title=""></a>
     
       </div>
       
 </div>
        
        
       
  <script type="text/javascript">
           
  var obj = document.getElementById("img1");

 
            var ggRoll = {
                 roll: obj,
                 speed: 16,
                 statusX: document.documentElement.clientWidth - document.body.clientWidth,
                 statusY: document.documentElement.clientHeight - document.body.clientHeight,
                 x: 200,
                 y: 400,
                 winW: document.body.clientWidth - obj.offsetWidth * 2,
                 winH: document.body.clientHeight - obj.offsetHeight,
                 Go: function () {
                     this.roll.style.left = this.x + 'px';
    
                 this.roll.style.top = this.y + 'px';

  
                   this.x = this.x + (this.statusX ? -1 : 1);
  
   
                if (this.x < 0) {
                         this.statusX = 0;
                     }
                     if (this.x > this.winW) {
                         this.statusX = 1;
                     }

                     this.y = this.y + (this.statusY ? -1 : 1);
   
                  if (this.y < 0) {
                         this.statusY = 0;
                     }
                     if (this.y > this.winH) {
                         this.statusY = 1;
                     }
                 }
             }

             var intervaly = setInterval("ggRoll.Go()", ggRoll.speed);

    
         ggRoll.roll.onmouseover = function () {
                 clearInterval(intervaly);
             };

             ggRoll.roll.onmouseout = function () {
                 intervaly = setInterval("ggRoll.Go()", ggRoll.speed);
             };

     
        function closediv() {
                 clearInterval(intervaly);
                 obj.style.display = "none";
                 obj.parentNode.removeChild(obj);
             }
  
  </script>

         
<!---飘窗结束--->

img.style.left = xPos + scrollLeft +'px';
img.style.top = yPos + scrollTop +'px';
if (yon) {
yPos = yPos + step;
} else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
} else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function start() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
start();
</script>
</body>
</html>nt.clientHeight || document.body.clientHeight;
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
scrollTop = document.documentElement.scrollLeft || document.body.scrollTop;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + scrollLeft +'px';
img.style.top = yPos + scrollTop +'px';
if (yon) {
yPos = yPos + step;
} else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
} else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}
function start() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
start();
}
</style>
级别: 管理员
UID: 136269
积分:8356 加为好友
威望: 0 精华: 0
主题:0 回复:6382
注册时间:2020-10-26
在线时长:0
2#   发表于:2021-03-29 13:02:03  IP:111.203.*.*
标签写法不规范问题,您自己看看报错位置修改
不是享乐,也不是受苦;而是行动,在每个明天,我们命定的目标和道路,都要比今天前进一步。
1 共1页