검색 본문
/* 고급검색 */
var detailSearchResult = { A : [], O : [], N : [] };
(function(){ var NetizenToggle = function(type){ this.type = (type) ? type : ""; this.btnEl = daum.$E("netizen_more_btn_" + type); this.listsWrapper = daum.$E("netizen_lists_" + this.type); this.lists = daum.$$("#netizenColl_" + this.type + " .list_keyword span.wsn"); this.etccode = 1; }; NetizenToggle.prototype = { getType: function(){ var lists = this.lists; var type = ""; var list = this.lists[this.lists.length-1]; var top = daum.Element.getCoordsTarget(list, list.parentNode).top; if(top > 40){ type = "type3"; }else if(top > 25){ type = "type2"; }else{ type = "type1"; } return type; }, checkFirstTime: function(){ this.check(); }, setBtnStatus: function(opt1, opt2){ if(opt1=="more"){ this.btnEl.removeClassName("fold"); this.btnEl.innerHTML = '더보기'; }else if(opt1=="fold"){ this.btnEl.addClassName("fold"); this.btnEl.innerHTML = '접기'; } if(typeof(opt2)!="undefined"){ if(opt2=="hide"){ this.btnEl.addClassName("hide"); }else if(opt2=="show"){ this.btnEl.removeClassName("hide"); } } }, check: function(){ var type = this.getType(); if(this.listsWrapper.hasClassName("type2")){ if(type=="type1"){ this.setBtnStatus("more","hide"); this.listsWrapper.removeClassName("type2"); }else if(type=="type3"){ this.setBtnStatus("more","show"); } }else if(this.listsWrapper.hasClassName("type3")){ if(type=="type1"){ this.setBtnStatus("fold","hide"); this.listsWrapper.removeClassName("type3"); }else if(type=="type2"){ this.setBtnStatus("more","hide"); this.listsWrapper.className = "list_keyword type2"; } }else{ if(type=="type2"){ this.setBtnStatus("more","hide"); this.listsWrapper.className = "list_keyword type2"; }else if(type=="type3"){ if (this.btnEl.hasClassName('fold')) { this.setBtnStatus("fold","show"); this.listsWrapper.className = "list_keyword type3"; } else { this.setBtnStatus("more","show"); this.listsWrapper.className = "list_keyword type2"; } } } }, toggle: function(){ var type = this.getType(); if(type == "type1"){ }else{ if(this.btnEl){ if(this.btnEl.innerHTML == '더보기'){ this.setBtnStatus("fold"); this.listsWrapper.className = "list_keyword type3"; }else{ this.setBtnStatus("more"); this.listsWrapper.className = "list_keyword type2"; } } } }, init: function(){ if(this.btnEl){ daum.Event.addEvent(this.btnEl, "click", daum.Function.bind(function(e){ this.toggle(); }, this)); daum.Event.addEvent(window, "resize", daum.Function.bind(function(e){ this.check(); }, this)); this.checkFirstTime(); } } }; var netizenToggle; netizenToggle = new NetizenToggle("top"); netizenToggle.init(); setTimeout(function() { netizenToggle.checkFirstTime(); },0); })();
카페 게시글
게시글 본문내용
|
다음검색
댓글
검색 옵션 선택상자
댓글내용선택됨
옵션 더 보기