$(function () { var offset = 100, offset_opacity = 1200, scroll_top_duration = 1000, $back_to_top = $('.cd-top'); $(window).scroll(function () { ($(this).scrollTop() > offset) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible'); }); $back_to_top.on('click', function (event) { event.preventDefault(); $('body,html').animate({ scrollTop: 0, }, scroll_top_duration ); }); //返回顶部 $(window).scroll(function () { if ($(window).scrollTop() >= 100) { $(".Header").addClass("fixednav"); } else { $(".Header").removeClass("fixednav"); } }); // 头部悬浮 $(".header_menu").click(function () { $(".Showbox").animate({ "right": "0px" }, 300); }); $(".Showbox .close_bar").click(function () { $(".Showbox").animate({ "right": "-100%" }, 300); }); $(".Nav li").each(function () { var subwidth = $(this).find(".SubNav").text() == " "; if (subwidth == true) { $(this).find(".am").after(" "); $(".SubNav").css({"padding":"10px 0px"}) } else { $(".SubNav").css({"padding":"0px"}) } }); $(".Nav li i").click(function () { $(this).parents("li").toggleClass("on").siblings().removeClass("on"); }); //获取浏览器宽度 var _width = $(window).width(); if (_width > 998) { $(".Nav li").hover(function () { $(this).find(".SubNav").stop(true, true).slideToggle(); }); } else { } $(".sbtn").click(function () { $(this).toggleClass("on") $(".Search").stop(true, true).slideToggle(); }); }) //top $(function () { $(".Menu .title").click(function () { $(".Menu ul").slideToggle(); }) }); $(document).ready(function () { $('.gallery').each(function () { // the containers for all your galleries $(this).magnificPopup({ delegate: 'a', // the selector for gallery item type: 'image', gallery: { enabled: true } }); }); }); $(function () { $(".JobList li:first-child").addClass("lion"); $(".JobList li:first-child").find(".Con").slideDown(500); $(".JobList li").each(function () { var Btn = $(this).find(".box"); Btn.click(function () { var statis = $(this).parents("li").find(".Con").css("display"); if (statis == "none") { $(this).parents("li").siblings().removeClass("lion"); $(this).parents("li").siblings().find(".Con").slideUp(500); $(this).parents("li").addClass("lion"); $(this).parents("li").find(".Con").slideDown(500); } else { $(this).parents("li").find(".Con").slideUp(500); $(this).parents("li").removeClass("lion"); } }); }); }); $(function () { $(".SlideTxt").slide(); $(".SinglePage img").removeAttr("height"); $(".SinglePage img").parent("p").removeAttr("style"); $(".SinglePage img").parent("p").css({ "text-indent": "0em", "text-align": "center" }); }) //获取浏览器宽度 $(function () { var _width = $(window).width(); if (_width > 480) { // 初始化 第一个 状态 $(".LifeList li:first-child").addClass('curr'); $(".LifeList li").hover(function () { $(this).addClass('curr').siblings().removeClass('curr'); }, 0); } else { } }); // 手风琴