在我的网站上,我有一个两个fancybox实例
问题是当有人点击div并开始观看视频时,如果同时传递25秒,它将打开简报弹出窗口并关闭已经打开的视频弹出窗口。这会给任何有解决方案的网站用户带来糟糕的体验吗?
以下是fancybox实例
的代码视频弹出式jquery
jQuery("#yblock").click(function() {
jQuery.fancybox({
'padding' : 0,
'aspectRatio' : true,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 780,
'height' : 500,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
},
helpers : {
'overlay': {
'locked': false
}
}
时事通讯popup jquery
jQuery(function ($) {
setTimeout(function () {
beginNewsletterForm();
}, 25000);
});
function beginNewsletterForm() {
jQuery.fancybox({
'padding': '0px',
'autoScale': true,
'transitionIn': 'fade',
'transitionOut': 'fade',
'type': 'inline',
'href': '#newsletter_popup',
'onComplete': function () {
$.cookie('newsletter_popup', 'shown');
},
'tpl': {
closeBtn: '<a title="Close" class="fancybox-item fancybox-close fancybox-newsletter-close" href="javascript:;"></a>'
},
'helpers': {
overlay: {
locked: true
}
}
});
jQuery('#newsletter_popup').trigger('click');
}
如果第一个fancybox已经打开,我想阻止第二个fancybox打开
答案 0 :(得分:1)