0

我的应用程序中有多个页面。我使用 jquery mobile fullCalendar.js 框架创建日历。现在我的问题是,当我单击应用程序页面的任何后退按钮并返回日历页面时,日历会重复。

4

1 回答 1

0

假设您在 DOM Ready 上调用fullCalendar函数,那么在调用之后您将有一个基本的 html 结构,有点像这样:

<div id="myCalendar" class="fc">
    <table style="width:100%; margin-bottom:20px" class="fc-header">
    </table>
    <div class="fc-content">
    </div>
</div>

然后你可以简单地做的是,在fullCalendar调用引入这样的谓词之前:

if ($('.fc').find('.fc-content').length <= 0)
   console.log('call .fullCalendar()');
else
   console.log('dont do anything');

希望这对你有用。

于 2013-08-06T09:50:45.863 回答