(function($){ /* 下拉框 */ var selectobj = { selectwrap: $('.easysite-simulate-select'), selectoption: $('.easysite-select-option', this.selectwrap), init: function() { this.events(); }, showselect: function(elem, opul) { this.selectoption.hide(); $('ul', this.selectoption).hide(); elem.show(); opul.show(); }, selectedarea: function(elem, index, curoption, curul) { var $simulateselect = elem.parents('.easysite-simulate-select'), $headerinput = $('.easysite-header-input', $simulateselect), $headerinputhidden = $('.easysite-header-input-hidden', $simulateselect); curoption.hide(); curul.hide(); $('li', curoption).removeclass('easysite-active').eq(index).addclass('easysite-active'); $headerinput.val(elem.text()); $headerinputhidden.val(elem.data('value')); $headerinput.trigger('blur'); }, events: function() { var that = this; $('.easysite-select-header', that.selectwrap).on('click', function(e) { e.stoppropagation(); var $this = $(this), $option = $this.parents('.easysite-simulate-select').find('.easysite-select-option'), $opul = $option.find('ul'); that.showselect($option, $opul); }); that.selectoption.on('click', 'li', function() { var $this = $(this), index = $this.index(), $curseloption = $this.parents('.easysite-select-option'), $curul = $('ul', $curseloption); that.selectedarea($this, index, $curseloption, $curul); }); $(document).on('click',function() { that.selectoption.hide(); }); } }; selectobj.init(); $('.easysite-td-row:even').css('background-color','#ffffff'); $('.easysite-td-row:odd').css('background-color', '#f3f3f3'); })(jquery); function queryclick(url,form) { $("#"+form).attr("action",url); $("#"+form).submit(); } //分页查询 function jumptoclick(totalpages,pageno,jumpurl,form){ var turnpage=$("#turnpage").val(); if($.trim(turnpage)==""){ alert("不能为空"); $("#turnpage").val(pageno); return; } if(isnan(turnpage)){//不为数字 alert("不为数字"); $("#turnpage").val(pageno); return; } if(parseint(turnpage)!=turnpage){ alert("不是整数"); $("#turnpage").val(pageno); return; } if(parseint(turnpage)>parseint(totalpages)||parseint(turnpage)<1){ alert("超出范围"); $("#turnpage").val(pageno); return; } jumpurl=jumpurl.replace("%1",turnpage); queryclick(jumpurl,form); }