当前位置:   article > 正文

html设置天气_html天气预报静态页面

html天气预报静态页面

1 js

(function (d) {
  var a = d.getElementById('weather-float-he')
  if (a) {
    a.parentNode.removeChild(a)
  }
  a = d.createElement('div')
  a.id = 'weather-float-he'
  var b = d.getElementsByTagName('body')[0]
  b.appendChild(a);
  var c = d.createElement('link')
  c.rel = 'stylesheet'
  c.href = 'https://apip.weatherdt.com/float/static/css/tqw_widget_float.css?v=0101'
  var s = d.createElement('script')
  s.src = 'https://apip.weatherdt.com/float/static/js/tqw_widget_float.js?v=0101'
  var sn = d.getElementsByTagName('script')[0]
  sn.parentNode.insertBefore(c, sn)
  sn.parentNode.insertBefore(s, sn)
})(document)

2 页面

<!DOCTYPE html>
<html>
<head>
   <title>中国天气</title>
   <style>
      #weather-float-he {
         position: fixed!important;
         z-index: 99999!important;
         left: 0!important;
         top: 0!important;
         transform: scale(.9);
      }
      #weather-float-he div[data-v-0a6ec0b4]{
         box-shadow: none!important;
         top: 42px!important;
      }
      #weather-float-he div[data-v-0a6ec0b4] div{
         position:static!important;
      }
      body,html{
         margin: 0;
         width: 100%;
         height: max-content;
      }
   </style>
</head>
<body>
<script type="text/javascript">
  WIDGET = {FID: 'FS17XUsOiV'}
</script>
<script type="text/javascript" src="https://apip.weatherdt.com/float/static/js/r.js?v=1111"></script>
</body>
</html>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/906612
推荐阅读
相关标签
  

闽ICP备14008679号