0
나는 한 파일에서 내 사이트에 필요한 모든 자바 스크립트 코드를 제공하는 common.js 라이브러리가 있습니다. 것은 그 파일에 다음 코드가 있고 모든 페이지에서 열리고 있지만 visiotr이 특정 페이지를 열 때만 열어야한다는 것입니다.특정 페이지에만 컬러 박스를 표시/열기하는 방법
// 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',
});
}
};