$(document).ready(function ($) { //to top jquery().uitotop({ easingtype: 'easeoutquart' }); // tabs function // $('.tabs-wrapper').each(function () { $(this).find(".tab-content").hide(); //hide all content $(this).find("ul.tabs li:first").addclass("active").show(); //activate first tab $(this).find(".tab-content:first").show(); //show first tab content }); $("ul.tabs li").click(function (e) { $(this).parents('.tabs-wrapper').find("ul.tabs li").removeclass("active"); //remove any "active" class $(this).addclass("active"); //add "active" class to selected tab $(this).parents('.tabs-wrapper').find(".tab-content").hide(); //hide all tab content var activetab = $(this).find("a").attr("href"); //find the href attribute value to identify the active tab + content $("li.tab-item:first-child").css("background", "none"); $(this).parents('.tabs-wrapper').find(activetab).fadein(); //fade in the active id content e.preventdefault(); }); $("ul.tabs li a").click(function (e) { e.preventdefault(); }); $("li.tab-item:last-child").addclass('last-item'); }); //响应式导航 $(function () { $(".navbar-header").on('click', function () { $('.navbar-menu').addclass('active'); $('.navbar-bg').addclass('active'); }) $(".navbar-bg").on("click", function () { $('.navbar-menu').removeclass('active'); $('.navbar-bg').removeclass('active'); }); if ($(window).width() < 992){ $('.navbar-menu li').each(function () { if ($(this).children('ul.dropdown_menu').length){ $(this).find("a").css({ 'pointer-events': 'none', }); $(this).find("ul.dropdown_menu li a").css({ 'pointer-events': 'inherit', }); } }); $(".navbar-menu li").click(function () { $(this).children('ul.dropdown_menu').slidetoggle(); $(this).siblings('li').children('ul.dropdown_menu').slideup(); }); } }) //手机端a标签当前页打开 if ($(window).width() < 1200) { $("a").attr("target", ""); } //滚动 $(document).ready(function () { $("#owl-demo").owlcarousel({ items: 1, lazyload: true, navigation: true, autoplay: true, pagination: false, responsive: false }); });