当前位置: 移动技术网 > IT编程>网页制作>CSS > 当地天气调用

当地天气调用

2019年01月19日  | 移动技术网IT编程  | 我要评论
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>document</title>
    <style>
    body{
        color: red;
        background: #fff;
    }
    </style>
</head>

<body>
    <div class="weather">
        <iframe class="iframe" name="weather_iframe" scrolling="no" frameborder="0" allowtransparency="true" src="//i.tianqi.com/index.php?c=code&id=12&color=%23ffffff&icon=1&num=1&site=12"></iframe>
    </div>
    <div id="tp-weather-widget"></div>
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <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"))
    
    tpwidget("init", {       
        "flavor": "slim",
               "location": "wx4fbxxfke4f",
               "geolocation": "enabled",
               "language": "zh-chs",
               "unit": "c",
               "theme": "chameleon",
               "container": "tp-weather-widget",
               "bubble": "enabled",
               "alarmtype": "badge",
               "color": "#f47837",
               "uid": "uc6ad9e048",
               "hash": "76465b415261736ddd08da3f7f9b24d0"   
    });   
    tpwidget("show");
    </script>
</body>

</html>

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网