一個博客中看到一個比較好的功能,能夠顯示時間日期以及地區天氣情況:
主要代碼:
<div class="welcome-info" style="margin-left: 20px;"> <div><span id="weather" style="color: #B0E0E6; font-size: 15px;background-color:grey;"></span></div> </div> <script type="text/javascript"> $('#weather').leoweather({ format: '{時段}好!,<span id="colock">現在時間是:<strong >{年}年{月}月{日}日 星期{周} <span style=" color: #FF7F00">{時}:{分}:{秒}</span></strong>,</span> <b>{城市}天氣</b><span style=" color: #FF7F00"> {天氣} </span>{夜間氣溫}℃ ~ {白天氣溫}℃' }); </script>
引用的js地址 : weather.js