开发者

JQUERY UI Dialog

I want to open a j开发者_StackOverflowquery UI dialog once, automatically. This can be done by setting the autoOpen property to true. But i need that to happen only once. How should I do it.


Since this is across pageloads, I'd set a cookie (via the cookie plugin in this example), like this:

var seenBefore = $.cookie("dialogOnce") == "1";
$("#elem").dialog({
  autoOpen: !seenBefore,
  open: function() { 
    //we've seen it, don't show for 180 days
    $.cookie("dialogOnce", "1", { expires: 180 }); 
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜