// -------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------- // 描述: 隐藏 // 依赖于: jQuery library; // 作者: 林卿; // 邮箱: lancer07@126.com // 日期: 2013-11-12 // -------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------- // START if(typeof ll !== 'object') var ll = {}; ll.twoLevelNavbar = function(el){ var $el = $(el); this.init = function(){ var index = $el.children("ul").children("li.cur").index(); $el.children("ul").children("li").bind('mouseover',function() { $(this).addClass("cur").siblings().removeClass("cur"); }); $el.children("ul").children("li").bind('mouseout',function() { if(index >= 0){ $el.children("ul").children("li").eq(index).addClass("cur").siblings().removeClass("cur"); }else{ $(this).removeClass("cur") } }); } } // -------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------- // END $(function(){ (new ll.twoLevelNavbar(".globalNav")).init(); (new ll.twoLevelNavbar(".personalNav")).init(); $('#sucaiNav,#newTipLi').hover(function(){ $(this).find('ul').show(); },function(){ $(this).find('ul').hide(); }); /*$('#loginedNav').mouseout(function(){ if( hasNewTip)$('#newTipLi').addClass('cur'); });*/ }); //搜索框无内容搜索处理 $(function () { $(".groupSearchBar input.topSearchBtn").on("click",function () { var _val = $(this).siblings(".topSearchText").val(); if(_val.length <= 0){ msgBox.show("请先输入搜索关键词", msgBox.warn); return false; } }) }); //检测输入跳转页面的输入框 function checkPage(obj) { var select = $(obj); if((parseInt(select.attr('value')) > select.attr('data-total'))){ select.attr('value', select.attr('data-total')); } if((parseInt(select.attr('value')) <= 0)){ select.attr('value', 1); } } $(document).click(function(e){ if ($(e.target).parents(".select_box").length === 0 && !$(e.target).hasClass('.select_box')) { $(".tag_options:visible").hide(); $('.tag_select_open').addClass('tag_select_hover'); $('.tag_select_open').removeClass('tag_select_open'); } });