0
我有一个common.js库,可以从一个文件中为我的网站提供所需的所有javascript代码。 事情是,我在该文件中有以下代码,并打开每个页面,但我需要打开时,只有当visiotr打开特定页面。如何仅在特定页面中显示/打开colorbox
// open thickbox
jQuery(document).ready(function($) {
$('a.js-thickbox-subscribe').fcolorbox2();
});
$.fn.fcolorbox2 = function() {
if (document.cookie.indexOf('visited=true') === -1) {
var expires = new Date();
expires.setDate(expires.getDate()+30);
document.cookie = "visited=true; expires="+expires.toUTCString();
$.colorbox({
inline:true,
overlayClose: false,
fixed: true,
href:'#test',
width:'700px',
height:'500px',
});
}
};