美文网首页
天气插件

天气插件

作者: EverglowLyu | 来源:发表于2019-06-14 13:15 被阅读0次

html

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

js

<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.seniverse.com/widget/chameleon.js"))
        </script>
        <script>
            tpwidget("init", {
                "flavor": "slim",
                "location": "WX4FBXXFKE4F",
                "geolocation": "enabled",
                "language": "zh-chs",
                "unit": "c",
                "theme": "chameleon",
                "container": "tp-weather-widget",
                "bubble": "disabled",
                "alarmType": "badge",
                "color": "#FFFFFF",
                "uid": "U9EC08A15F",
                "hash": "039da28f5581f4bcb5c799fb4cdfb673"
            });
            tpwidget("show");
        </script>

相关文章

网友评论

      本文标题:天气插件

      本文链接:https://www.haomeiwen.com/subject/zcvlfctx.html