$(document).ready(function () { // 不同屏幕下改变字体插件 (function ($) { $.fn.fontflex = function (min, max, mid) { var $this = this; $(window).resize(function () { var size = window.innerwidth / mid; if (size < min) size = min; if (size > max) size = max; $this.css('font-size', size + 'px'); }).trigger('resize'); }; })(jquery); $(function() { $('.new-bt p').fontflex(17,21,40); $('h3 span').fontflex(30, 40, 40); }); $('.liaojie-kong').hover(function () { $(this).parent().find("img").css({'transform':'scale(1.1,1.1)'}) },function () { $(this).parent().find("img").css({'transform':'scale(1,1)'}) }) // $('.box').hover(function () { // $(this).addclass("subnavact") // },function () { // $(this).removeclass("subnavact") // }) jquery(function () { var t; w_width = jquery(window).width(), w_height = jquery(window).height(), $navbox = jquery(".navbox"), $subnav = jquery(".subnav"), $mobilebox = jquery(".mobilebox"), $menubtn = jquery('#menu-handler'), $navmobile = jquery("#navmobile"), $moba = $navmobile.find("a"), $mobsubnav = $navmobile.find(".msubnav"); $serachbtn = jquery(".serachbtn"), $searchbox = jquery(".searchbox"), //pc nav jquery(".nav li").mouseenter(function () { if (jquery(this).hasclass("hov")) { return; }; cleartimeout(t); $searchbox.stop(false, false).animate({ top: 100, opacity: "hide" }, 200); serachitem = 0; jquery(".nav li").removeclass("hov"); jquery(this).addclass("hov"); jquery(".subbox").stop(false, false).animate({ top: 80, opacity: "show" }, 400).addclass("subboxact"); $subnav.removeclass("subnavact"); var subname = ".subnav" + (jquery(this).index() + 1); if (jquery(subname).length >= 1) { jquery(subname).stop(false, false).addclass("subnavact"); } }); $subnav.mouseenter(function () { if (jquery(this).hasclass("subnavact")) { return; }; cleartimeout(t); $subnav.removeclass("subnavact"); jquery(this).stop(false, false).addclass("subnavact"); var linname = ".nav .line" + (jquery(this).index() + 2); jquery(".nav li").removeclass("hov"); if (jquery(linname).length >= 1) { jquery(linname).stop(false, false).addclass("hov"); } }); $('.subbox').mouseenter(function () { cleartimeout(t); jquery(".subbox").stop(false, false).animate({ top: 80, opacity: "show" }, 400).addclass("subboxact"); }); $navbox.bind("mouseleave", function () { jquery(".nav li").removeclass("hov"); jquery(".subbox").removeclass("subboxact"); // t =settimeout(function () { // jquery(".subbox").stop(true, true).animate({ top: 100, opacity: "hide" }, 200); // },200); $subnav.removeclass("subnavact"); }); $('.subbox').mouseleave(function () { jquery(".nav li").removeclass("hov"); jquery(".subbox").removeclass("subboxact"); $subnav.removeclass("subnavact"); t =settimeout(function () { jquery(".subbox").stop(true, true).animate({ top: 100, opacity: "hide" }, 200); },200); }) //非pc nav //menubtn click $menubtn.bind('click', function (e) { if (navitem == 0 && scrollnav) { $menubtn.addclass("active"); $mobilebox.stop(false, false).slidedown(500); navitem = 1; serachitem = 0; $searchbox.stop(false, false).hide(); jquery('html, body').stop(false, false).animate({ scrolltop: 0 }, 700, 'easeinoutexpo'); } else if (navitem == 1 && !scrollnav) { jquery('html, body').stop(false, false).animate({ scrolltop: 0 }, 700, 'easeinoutexpo'); scrollnav = true; serachitem = 0; $searchbox.stop(false, false).hide(); } else { $menubtn.removeclass("active").removeclass("mobactive"); $mobilebox.slideup(200); navitem = 0; if (ismobile) { $moba.removeclass("cur"); $mobsubnav.hide(); } }; }); // 简单小轮播 $(".nav-banner li").hide().eq(0).show(); // 圆点 $('.nav-banner li').each(function () { $('.lun-circle').append('
  • '); $('.lun-circle li').eq(0).addclass('current') }) $(".lun-circle li").click(function(){ // 这行代码就是让index这个变量是当前移入圆点的编号 var index=$(this).index(); $('.lun-circle').append() $(".lun-circle li").eq(index).addclass("current").siblings().removeclass("current"); $(".nav-banner li").fadeout().eq(index).fadein(); }); $('.seek i').click(function () { if ($('.seek').hasclass('active')){ $('.seek').removeclass('active') }else { $('.seek').addclass('active') } }) }); });