$(function () { $('.phone-header .menu-list li .z1').click(function () { var _this = $(this); if (_this.hasClass('active')) { _this.removeClass('active').next('dl').slideUp(); } else { _this.addClass('active').next('dl').slideDown().parent('li').siblings('li').find('.z1').removeClass('active').next('dl').slideUp(); } }) $('.phone-header .menu-push').click(function () { var _this = $(this); if (_this.hasClass('menu-open')) { _this.removeClass('menu-open').next('.menu-list').slideUp(); } else { _this.addClass('menu-open').next('.menu-list').slideDown(); } }) $('.phone-header .menu-list ul').css('maxHeight', $(window).height() - 0); $('.header-slide').width($(window).width()); $('.header-bot .nav li').hover(function () { $(this).find('.header-slide').stop(true, true).fadeIn(0); }, function () { $(this).find('.header-slide').stop(true, true).fadeOut(0); }) $('.header-found form .link a').click(function () { $(this).addClass('on').siblings('a').removeClass('on'); $(this).nextAll('input').val($(this).html()); }) $('.header-bot .found-btn').click(function () { $('.header-found').slideToggle(); }) $('.phone-header .menu-list form .choose a').click(function () { $(this).addClass('on').siblings('a').removeClass('on'); $(this).nextAll('input').val($(this).html()); }) $('.backtop-btn').click(function () { $('body,html').animate({ 'scrollTop': '0' }, 1000) }) $(window).scroll(function () { var H = $(window).height(); if ($(window).scrollTop() > H) { if ($(window).width() < 1200) { $('.backtop-btn').css('display', 'none'); } else { $('.backtop-btn').stop(true, true).fadeIn(); } } else { if ($(window).width() < 1200) { $('.backtop-btn').css('display', 'none'); } else { $('.backtop-btn').stop(true, true).fadeOut(); } } }) //ul li dl dd a i $(document).ready(function () { $('.a1').click(function () { if ($(this).siblings('ul').css('display') == 'none') { $(this).parent('li').siblings('li').removeClass('inactives'); $(this).addClass('inactives'); $(this).siblings('ul').slideDown(300).children('li'); if ($(this).parents('li').siblings('li').children('ul').css('display') == 'block') { $(this).parents('li').siblings('li').children('ul').parent('li').children('a').removeClass('inactives'); $(this).parents('li').siblings('li').children('ul').slideUp(300); } } else { //控制自身变成+号 $(this).removeClass('inactives'); //控制自身菜单下子菜单隐藏 $(this).siblings('ul').slideUp(300); //控制自身子菜单变成+号 $(this).siblings('ul').children('li').children('ul').parent('li').children('a').addClass('inactives'); //控制自身菜单下子菜单隐藏 $(this).siblings('ul').children('li').children('ul').slideUp(300); //控制同级菜单只保持一个是展开的(-号显示) $(this).siblings('ul').children('li').children('a').removeClass('inactives'); } }) }); }) //下拉菜单 $(function() { var Accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // Variables privadas var links = this.el.find('.link'); // Evento links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown) } Accordion.prototype.dropdown = function(e) { var $el = e.data.el; $this = $(this), $next = $this.next(); $next.slideToggle(); $this.parent().toggleClass('open'); if (!e.data.multiple) { $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); }; } var accordion = new Accordion($('#accordion'), false); }); //下拉菜单 $(function() { var Accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // Variables privadas var links = this.el.find('.link'); // Evento links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown) } Accordion.prototype.dropdown = function(e) { var $el = e.data.el; $this = $(this), $next = $this.next(); $next.slideToggle(); $this.parent().toggleClass('open'); if (!e.data.multiple) { $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); }; } var accordion = new Accordion($('#accordion1'), false); }); $(document).ready(function (e) { $(".head .topBox .left .qg").bind("mouseover", function (e) { $(".head .topBox .left ").find("ul").show(); }); $(".head .topBox .left ul").bind("mouseleave", function (e) { $(".head .topBox .left ").find("ul").hide(); }) });