码迷,mamicode.com
首页 > 其他好文 > 详细

可以放在页面任何地方de 天气插件

时间:2017-02-05 12:24:49      阅读:371      评论:0      收藏:0      [点我收藏+]

标签:ini   view   unit   device   arguments   theme   idt   htm   oca   

<!DOCTYPE html>

<html>

      <head>

           <meta charset="UTF-8">

           <title>天气</title>

           <meta name="viewport" content="width=device-width,initial-scale=1"/>

           <style type="text/css">

                 .xc{

                      width: 200px;

                      margin: 0 auto;

                 }

           </style>

      </head>

 

      <body>

           <div id="tp-weather-widget" class="xc"></div>

           <script>

                 (function(T, h, i, n, k, P, a, g, e) {

                      g = function() {

                            P = h.createElement(i);

                            a = h.getElementsByTagName(i)[0];

                            P.src = k;

                            P.charset = "utf-8";

                            P.async = 1;

                            a.parentNode.insertBefore(P, a)

                      };

                      T["ThinkPageWeatherWidgetObject"] = n;

                      T[n] || (T[n] = function() {

                            (T[n].q = T[n].q || []).push(arguments)

                      });

                      T[n].l = +new Date();

                      if(T.attachEvent) {

                            T.attachEvent("onload", g)

                      } else {

                            T.addEventListener("load", g, false)

                      }

                 }(window, document, "script", "tpwidget", "//widget.thinkpage.cn/widget/chameleon.js"))

           </script>

           <script>

                 tpwidget("init", {

                       "flavor": "slim",

                      "location": "WX4FBXXFKE4F",

                      "geolocation": "disabled",

                      "language": "zh-chs",

                      "unit": "c",

                      "theme": "chameleon",

                      "container": "tp-weather-widget",

                      "bubble": "enabled",

                      "alarmType": "badge",

                      "color": "#F47837",

                      "uid": "U605DCADA4",

                      "hash": "78f46a1198d54dafa0cda717efa717a9"

                 });

                 tpwidget("show");

           </script>

          

      </body>

</html>

 技术分享

可以放在页面任何地方de 天气插件

标签:ini   view   unit   device   arguments   theme   idt   htm   oca   

原文地址:http://www.cnblogs.com/ZZZAB/p/6367152.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!