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',
});
}
};