我regestering一个jQuery的fancybox像这样:检查jQuery“Fancybox”是否已经注册?
$(document).ready(function() {
$("#help").fancybox({
'width': '90%',
'height': '90%',
'autoScale': true,
'transitionIn': 'elastic',
'transitionOut': 'none',
'titleShow': false,
'type': 'iframe'
});
});
然而,在页面传送/回发是越来越多次注册,减慢下来,以突破点。有没有办法检查事件是否已经注册,如果没有,注册?
伪代码:
//check if fancybox has not been registered
if($("help").fancybox == null))
{
//register fancy box
}
Fancybox 2似乎并没有这样做。至少不是以我的经验。 –