/*** 导航 ***/ $(function(){ $('.m-nav .fir-li:last').css({'background':'none'}); }) /** banner **/ $(window).resize(function(){ Pagesize(); }); function Pagesize(){ if($('body').width() > 1000){ $('.m-focus .switchable-content li').css({'width':$('body').width()}); }else{ $('.m-focus .switchable-content li').css({'width':'1000px'}); } }; $(function(){ $('.m-focus .switchable-content li').each(function(index, element) { var imgSrc=$(this).find('img').attr('src'); $(this).css('background','url('+imgSrc+') no-repeat scroll 50% 0px transparent'); }); Pagesize(); $('.m-focus').slide({ //direction: 'y', speed: 'slow', navCls: 'switchable-nav', contentCls: 'switchable-content', caption: true, //是否带有标题 //prevBtnCls:'u-focus-prev', //nextBtnCls:'u-focus-next', evtype: 'click', effect:'fade' //'random', 'normal', 'fade', 'scroll', 'fold', 'slice', 'slide', 'shutter', 'grow' }); }); //公告 $(function(){ $('.f-ann').carouFredSel({ responsive: true, direction : 'up', //prev: '.u-prev', //next: '.u-next', width: '910px', auto:{ play:true, timeoutDuration:3000, pauseOnHover:true }, pause:3000, scroll: 1, items: { visible: { min: 1, max: 1 } } }); }); //subBan $(function(){ if($('.m-subFocus').length>0){ var subImg=$('.m-subFocus img').attr('src'); $('.m-subFocus').css({'background':'url('+subImg+') center top no-repeat'}); }; }); //标题 $(function(){ $('.main-title').each(function(index, element) { var emW=$(this).find('em').width()+5; $(this).find('h2').css({'padding-left':emW}); }); }); /** 新闻滚动 **/ $(function(){ $('.m-newsScroll .f-news').carouFredSel({ responsive: true, direction : 'up', //prev: '.u-prev0', //next: '.u-next0', width: '790px', auto:{ play:true, timeoutDuration:3000, pauseOnHover:true }, pause:3000, scroll: 1, items: { visible: { min: 1, max: 1 } } }); }); //加入收藏 function addFavorite(obj, url, title) { var e = window.event || arguments.callee.caller.arguments[0]; var B = { IE : /MSIE/.test(window.navigator.userAgent) && !window.opera , FF : /Firefox/.test(window.navigator.userAgent) , OP : !!window.opera }; obj.onmousedown = null; if (B.IE) { obj.attachEvent("onmouseup", function () { try { window.external.AddFavorite(url, title); window.event.returnValue = false; } catch (exp) {} }); } else { if (B.FF || obj.nodeName.toLowerCase() == "a") { obj.setAttribute("rel", "sidebar"), obj.title = title, obj.href="vsm;" } else if (B.OP) { var a = document.createElement("a"); a.rel = "sidebar", a.title = title, a.href="vsm;" obj.parentNode.insertBefore(a, obj); a.appendChild(obj); a = null; } } } //设为首页 function setHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try{ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }catch(e){ alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'"); } }else{ alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将【"+url+"】设置为首页。"); } } } $(function() { /*用于单行分类的对齐 START*/ $('.j-child-neat').each(function(index, element) { var ulwidth = $(this).width(); var liNum = $(this).children(); var liLeng=liNum.length; for(i=0;i0){$(this).addClass('j-li');} $(this).hover(function(){ $(this).addClass('hover').siblings().removeClass('hover'); //当前主导航添加样式:current,其他的删除样式:current },function(){ $(this).removeClass('hover'); //当前主导航添加样式:current,其他的删除样式:current }); }); $('.m-nav li').each(function(index, element) { $(this).hover(function(){ $(this).addClass('hover').siblings().removeClass('hover'); //当前主导航添加样式:current,其他的删除样式:current },function(){ $(this).removeClass('hover'); //当前主导航添加样式:current,其他的删除样式:current }); }); /*横向导航 START*/ $('.nav-x .sec-ul').each(function(index, element) { var ulwidth = 0; var uli = $(this).find('li'); for(i=0;i