$(function () { // 菜单切换 $('.menu li').click(function () { $(this).addclass('active').siblings().removeclass('active'); }); // 搜索 $('.search').mouseenter(function () { if (!$('.search-case').hasclass('searchshow')) { $('.search-case').addclass('searchshow') } }); $('.search-case').mouseenter(function () { $('.search-case').addclass('searchshow') }); $('.search-case').mouseleave(function () { $('.search-case').removeclass('searchshow') }); // 首页-新闻列表 // $('.tab-focus li').mouseenter(function () { // var _index = $(this).index(); // $(this).addclass('cue').siblings().removeclass('cue'); // $('.news-list > .focus_ul').eq(_index).show().siblings().hide(); // }); $('.focus-top > a').attr('href', $('.tab-focus ll.cue a').attr('links')); $('.tab-focus li').mouseenter(function () { var _index = $(this).index(); var links = $(".tab-focus li a").eq(_index).attr('href'); $('.focus-top > a').attr('href', links); $(this).addclass('cue').siblings().removeclass('cue'); $('.news-list > .focus_ul').eq(_index).show().siblings().hide(); }); // 首页-底部上方新闻列表 $('.basic-top > a').attr('href', $('.tab-basic ll.cue a').attr('links')); $('.tab-basic li').mouseenter(function () { var index = $(this).index(); var links = $(".tab-basic li a").eq(index).attr('href'); $('.basic-top > a').attr('href', links); $(this).addclass('cue').siblings().removeclass('cue'); $('.basic-list > .basic_ul').eq(index).show().siblings().hide(); }); // index-友情链接 $(".links p").click(function () { $(".links-details").show() }); $(".links-details").mouseleave(function () { $(".links-details").hide() }) //箭头移动大小 $(".down-icon").click(function () { var h = $(window).scrolltop(); //获取当前滚动条距离顶部的位置 $("html,body").animate({ scrolltop: h + 600 }, 600); }); // 关于我们菜单 $('.about-tab li').click(function () { $(this).addclass('active').siblings().removeclass('active'); }); // 党建菜单 $('.menu-ul li').click(function () { $(this).addclass('curr').siblings().removeclass('curr'); }); // 代表项目 $('.layout_cont > .layout_item:first-child').show(); $('.represent_tab a').click(function () { var index = $(this).index(); $(this).addclass('cur').siblings().removeclass('cur'); $('.layout_cont > .layout_item').eq(index).show().siblings().hide(); }); //分享 $('.share_box li').mouseenter(function () { $(this).find(".share_code").show(); // $(".share_code").show(); }); $(".share_code").mouseleave(function () { $(this).hide() }) $(".share_box li").mouseleave(function () { $(this).find(".share_code").hide(); // $(".share_code").hide() }) })