简单易懂的天气插件(代码分享)

时间:2021-05-18

效果图如下:

代码如下所示:

<!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>

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章