我在一个小型的jquery移动框架站点中实现了flot。包含flot的页面/内容div在辅助页面上。第一次显示flot页面时,图表呈现得很好。返回到主页面并再次前进到flot页面时,图表不会呈现。
内容来自asp mvc视图:
<div id="chartcontainer">
<div id="chartdiv" style="height:300px;width:400px;"></div>
</div>
<script type="text/javascript">
$(function () {
var d1 = [[1, 1], [2, 2], [3, 3]];
$.plot($("#chartdiv"), [d1]);
});
</script> 发布于 2011-04-28 11:13:22
您可能需要刷新页面,请尝试使用.page()
$.plot($("#chartdiv"), [d1]).page();发布于 2011-04-28 18:23:22
文档就绪通常不会像jQuery移动设备预期的那样工作。
尝试绑定到page*事件而不是$(function(){}),如下所示:
$('div#withMYgrid').live('pageshow',function(){
//plot here
});https://stackoverflow.com/questions/5812709
复制相似问题