87,910
社区成员
发帖
与我相关
我的任务
分享
<body>
<div class="M-weather sunny-bg" id="weather_id">
<div class="weather-head">
<h1>天气预报情况</h1>
<select name="city" id="city" onchange="changeCity(this)">
<option value="广州市">广州市</option>
<option value="深圳市">深圳市</option>
</select>
</div>
<!--<p class="weather-p">温馨提示:夜间有大雨,请带好雨具</p>-->
<ul class="weather-content" id="weatherSource">
</ul>
<script type="text/x-dot-template" id="weatherSourceTmpl">
{{~it:item}}
<li class="today">
<p>{{=item.dateDescribe}}</p>
<!--<span class="weather-icon"></span>-->
<span class="weather-icon">
<i class="{{=item.weatherTypePic}}"></i>
</span>
<p>{{=item.weatherTypeName}}<br>{{=item.minTemperature}}/{{=item.maxTemperature}}度</p>
<p>{{=item.windDiretion}} ≤{{=item.windLevel}}级</p>
</li>
{{~}}
</script>
</div>
</body>
var weather_canvas=null;
html2canvas($("#weather_id"),{
allowTaint: true,
taintTest: false,
onrendered: function(canvas) {
canvas.id = "mycanvas";
//document.body.appendChild(canvas);
//生成base64图片数据
weather_canvas = canvas.toDataURL();
//console.log(weather_canvas);
top.weatherpic=weather_canvas;
}
});