$(function () { $(".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 == false) { $(this).find(".am").after(" "); $(this).find(".subnav").css({"padding":"10px 0px"}) } else { $(this).find(".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 () { $(".search").stop(true, true).slidetoggle(); }); }) //top $(function () { //获取浏览器宽度 var _width = $(window).width(); if (_width < 800) { //直接为该div添加w1024样式,会覆盖前一个样式 $(".menu").addclass("meunbtn"); $(".meunbtn .title").click(function () { $(".menu ul").slidetoggle(); }) } else { } }); $(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" }); $(".history .item .txt").children().removeattr("style"); $(".history .item .txt p").children().removeattr("style"); $(".history .item .txt p span").children().removeattr("style"); }) //获取浏览器宽度 $(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 { } }); // 手风琴 $(function () { var offset = 300, offset_opacity = 1200, scroll_top_duration = 1000, $back_to_top = $('.gotop'); $(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 ); }); }) //返回顶部 $(function () { $('.zjselectbox').each(function (i) { var _this = $(this); var spantxt = _this.find('.zjselecttxt span').text(); _this.find('.zjselecttxt').click(function (enevt) { $('.zjselectbox').not($('.zjselectbox').eq(i)).find('.zjselectul').stop(true).slideup(); _this.find('.zjselectul').stop(true).slidetoggle(); $(this).find('.icon').toggleclass('iconon'); $('.zjselectbox').not($('.zjselectbox').eq(i)).find('.icon').removeclass('iconon'); enevt.stoppropagation(); }); _this.find('.zjselectulbox ul li').click(function (enevt) { _this.find('.zjselecttxt span').text($(this).text()); _this.find('.zjselectul').stop(true).slideup(); $('.zjselectbox .icon').removeclass('iconon'); enevt.stoppropagation(); }); }); }); /*仿下拉框*/