/** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */ ;window.MobileSelect=function(){function e(e,t){return e.getElementsByClassName(t)}function t(e){this.mobileSelect,this.wheelsData=e.wheels,this.jsonType=!1,this.jsonData=[],this.checkDataType(),this.renderWheels(this.wheelsData),this.displayJson=[],this.cascade=!1,this.startY,this.moveEndY,this.moveY,this.oldMoveY,this.offset=0,this.offsetSum=0,this.oversizeBorder,this.curDistance=[],this.clickStatus=!1,this.init(e)}return t.prototype={constructor:t,init:function(t){var i=this;if(i.trigger=document.querySelector(t.trigger),i.wheel=e(i.mobileSelect,"wheel"),i.slider=e(i.mobileSelect,"selectContainer"),i.wheels=i.mobileSelect.querySelector(".wheels"),i.liHeight=i.mobileSelect.querySelector("li").offsetHeight,i.ensureBtn=i.mobileSelect.querySelector(".ensure"),i.closeBtn=i.mobileSelect.querySelector(".cancel"),i.grayLayer=i.mobileSelect.querySelector(".grayLayer"),i.popUp=i.mobileSelect.querySelector(".content"),i.callback=t.callback?t.callback:function(){},i.transitionEnd=t.transitionEnd?t.transitionEnd:function(){},i.initPosition=t.position?t.position:[],i.titleText=t.title?t.title:"",i.triggerDisplayData="undefined"==typeof t.triggerDisplayData||t.triggerDisplayData,i.trigger.style.cursor="pointer",i.setTitle(i.titleText),i.checkCascade(),i.cascade&&i.initCascade(),0==i.initPosition.length)for(var n=0;n
取消
完成
',document.body.appendChild(t.mobileSelect);for(var i="",n=0;n"}t.mobileSelect.querySelector(".wheels").innerHTML=i},addListenerAll:function(){for(var e=this,t=0;t0){e.cascade=!0;break}}else e.cascade=!1},initCascade:function(){var e=this;e.displayJson.push(e.generateArrData(e.jsonData)),e.checkArrDeep(e.jsonData[0]),e.updateWheels()},generateArrData:function(e){for(var t=[],i=0;i0&&(t.displayJson.push(t.generateArrData(e.childs)),t.checkArrDeep(e.childs[0]))},checkRange:function(e,t){for(var i=this,n=i.displayJson.length-1-e,s=0;st.length){i=n.slider.length-t.length;for(var a=0;ae.displayJson.length)for(var t=e.wheel.length-e.displayJson.length,i=0;i'+e.displayJson[t][n].value+"";e.slider[t].innerHTML=i}else{var s=document.createElement("div");s.className="wheel",i='
    ';for(var n=0;n'+e.displayJson[t][n].value+"";i+="
",s.innerHTML=i,e.addListenerWheel(s,t),e.wheels.appendChild(s)}e.addListenerLi(t)}(i)},updateWheel:function(e,t){for(var i=this,n="",s=0;s"+t[s]+"";i.slider[e].innerHTML=n,i.addListenerLi(e)},fixRowStyle:function(){for(var e=this,t=(100/e.wheel.length).toFixed(2),i=0;i2*n.liHeight?(n.curDistance[i]=2*n.liHeight,setTimeout(function(){n.movePosition(t,n.curDistance[i])},100)):n.curDistance[i]+n.offsetSum2*n.liHeight?(n.curDistance[i]=2*n.liHeight,setTimeout(function(){n.movePosition(t,n.curDistance[i])},100)):n.curDistance[i]+n.offsetSum