/* * 公共js * * */ appearshow(); // 当前页面头部导航高亮 function appearshow() { $(".wgt-fade-animate").each(function () { var fold = $(window).height() + $(window).scrolltop(); if (fold > $(this).offset().top) { $(this).trigger("appear"); } }); } $(function () { // 滚至可见区域渐现 $(window).bind("scroll", function (event) { appearshow(); }); $(".wgt-fade-animate").on("appear", function () { $(this).addclass('appear'); }); }); // header $(window).ready(function () { //header var $nav_li = $(".nav li "); var $top = $(".head_nav"); $nav_li.hover(function () { $(this).find(".down_con").finish().slidedown(); $(this).find(".down_con").addclass("on"); $(".head").addclass("on") }); $nav_li.mouseleave(function () { $(this).find(".down_con").slideup("fast"); $(this).find(".down_con").removeclass("on"); $(".head").removeclass("on") }); $top.hover(function () { $(".head_nav").addclass("change_w") }); $top.mouseleave(function () { $(".head_nav").removeclass("change_w") }); // var $nav_li = $(".nav_block li "); $nav_li.hover(function () { $(this).find(".nav_tow").stop(true, false).slidedown(); $(this).find(".nav_xian").css("display", "block") //线 }); $nav_li.mouseleave(function () { $(this).find(".nav_tow").slideup(); $(this).find(".nav_xian").css("display", "none") //线 }); // $(".headmenu").on('click', function () { $(this).toggleclass("on"); $(".headmenu_box").slidetoggle(); }); $(".headmenu_li>a").on('click', function () { $(this).toggleclass("change"); $(this).parents(".headmenu_li").siblings().find(".change").removeclass("change") $(this).siblings(".headmenu_a").slidetoggle(); $(this).parents(".headmenu_li").siblings().find(".headmenu_a").slideup(); }) $(".headmenu_two").on('click',function(){ $(this).toggleclass("change") $(this).next(".headmenu_sub").slidetoggle(); }) $(".headmenu_click").on('click',function(){ $(this).toggleclass("change") $(this).parent().next(".headmenu_sub").slidetoggle(); }) // 定位 // $(".dw_nav ul li").on('click', function () { // $(this).addclass('active').siblings().removeclass('active'); // }) // 页码 $('.fanye_news a').click(function () { $(this).addclass('click_fanye_news').siblings().removeclass('click_fanye_news'); }) // if ($(window).width() < 768) { $(".wgt-fade-animate:first").addclass("appear") } $(window).resize(function () { if ($(window).width() < 768) { $(".wgt-fade-animate:first").addclass("appear") } }) })