"); $img.attr({id:"pld_"+preLoadId}); $img.data({preLoadId:preLoadId,tagSelector:param.selector}); $img.on("load",function () { $($(this).data("tagSelector")).addClass('preloaded'); _self._preloadList[$(this).data("preLoadId")].isLoad = true; }); $img.on("error",function () { $($(this).data("tagSelector")).addClass('preloaded'); _self._preloadList[$(this).data("preLoadId")].isLoad = true; }); $img.on("abort",function () { $($(this).data("tagSelector")).addClass('preloaded'); _self._preloadList[$(this).data("preLoadId")].isLoad = true; }); _self._$parent.append($img); $img.attr({src:url}); }; this.resetPreloadList = function(){ _self._preloadList = []; }; this.checkAllComplete = function(){ var beforeTime = new Date().getTime(); var localFunc = function () { var i, len = _self._preloadList.length, check = true, nowTime; for(i = 0; i < len;i++){ if(_self._preloadList[i].isLoad === false) { /*var $obj = $("#pld_"+_self._preloadList[i].preID); if($obj.size() > 0 && $obj.get(0).complete === false) { check = false; break; }*/ check = false; break; } } if(check){ localFunc = null; beforeTime = null; _self.dispatchEvent({"type":PreloadManager.EVENT.LOAD_COMPLETE,"status":"ok"}); return; }else{ nowTime = new Date().getTime(); if(nowTime - beforeTime < _self._WaitTime){ setTimeout(localFunc, 30 / 1000); }else{ for(i = 0; i < len;i++){ $("#pld_"+_self._preloadList[i].preID).addClass('preloaded'); _self._preloadList[i].isLoad =true; } localFunc = null; beforeTime = null; _self.dispatchEvent({"type":PreloadManager.EVENT.LOAD_COMPLETE,"status":"timeout"}); return; } } }; localFunc(); }; }; PreloadManager.EVENT = {}; PreloadManager.EVENT.LOAD_COMPLETE = "load_complete"; EventDispatcher.prototype.apply(PreloadManager.prototype); var _preloadManager, _preloadList, originList; var searchTagList = [[],[]]; var screenEffect; var screenChange; _preloadManager = new PreloadManager(); _preloadManager.addEventListener(PreloadManager.EVENT.LOAD_COMPLETE,function(){ $.ajax({ url:"./json/theater-list.json", dataType:"jsonp", jsonpCallback:"onResultsJson" }); }); _preloadList = [ {url:"./img/common.png",selector:"#contentsWrapper .bgWrapper,#titleWrapper .bgWrapper,#contentsWrapper #contents .moviesTitle,#searchWrapper .serachArea,#searchWrapper .tagWrapper,#searchWrapper .tabWrapper .text,#titleWrapper h1,#titleWrapper p.description,#searchWrapper .tabWrapper .tab .n02,#searchWrapper .tabWrapper .tab .n01,#searchWrapper .tagWrapper .tagList li a,#searchWrapper .tagWrapper .searchBtn,#contentsWrapper #contents .moviesList li a,.modal .modalWrapper,.modal .modalWrapper .closeBtn02,.modal .modalWrapper .closeBtn,.modal .modalWrapper .icon"} ]; function initPopup(){ $(".popupTrigger").on("click",function(e){ var scrollTop = (!CommonModule.CONSTANTS.IS_USER_AGENT.Mobile) ? $(CommonModule.CONSTANTS.SCROLL_ELEM).scrollTop() : window.scrollY, contentsTop = $("#titleWrapper").offset().top, modalTop; e.preventDefault(); if(scrollTop < contentsTop){ modalTop = contentsTop; }else{ modalTop = scrollTop; } var movieId = $(this).data("movieId"); var data = $.grep(originList,function(e){ return e.id == movieId }).pop(); var youtube = data.youtube; var name = data.name; var title = data.title; var subject = data.subject+" "+data.subject2; var link1 = data.link1; var linkList = [{ name:"link2", list:data.link2 },{ name:"link3", list:data.link3 },{ name:"link4", list:data.link4 }]; // $("#modalMovie").find("iframe").attr("src","http://www.youtube.com/embed/"+youtube+"?rel=0"); var $iframe = $("