/* * @Author: Marte * @Date: 2017-06-30 15:04:06 * @Last Modified by: Marte * @Last Modified time: 2018-08-06 21:09:44 */ 'use strict'; function nav() { //关闭click.bs.dropdown.data-api事件,使顶级菜单可点击 $(document).off('click.bs.dropdown.data-api'); $('.nav .dropdown').mouseenter(function(){ $(this).addClass('open'); }); $('.nav .dropdown').mouseleave(function(){ $(this).removeClass('open'); }); } function footer() { if ($(window).width()<768) { $('.col .phone-up').click(function(event) { $('.col .phone-up').removeClass('phone-down'); if ($(this).next(".phone-con").css('display')=='none') { $('.col .phone-con').slideUp(100); $(this).toggleClass('phone-down'); }; $(this).next(".phone-con").slideToggle(100); }); }; } function solidH() { var sv = $('.procon-v').next().height(); $('.procon-v').css('height', sv); } function sidebarh() { $('[data-toggle="tooltip"]').tooltip(); } $(function(){ $("#toTop").click(function(){ $("html").animate({"scrollTop": "0px"},100); //IE,FF $("body").animate({"scrollTop": "0px"},100); //Webkit }); }) $(function(){ var nav_li = $("li[data-nav]"); var windowUrl=window.location.href; nav_li.each(function(){ var t = $(this).attr('data-nav'); if(windowUrl.indexOf(t) > -1){ $(this).addClass('active'); } }) }) $(function(){ nav(); footer(); sidebarh(); }); $(".nb_icon_bridge0").hover(function(){ $("#nb_icon_groups").css("display","block!important"); },function(){ $("#nb_icon_groups").css("display","none"); }); $(function () { $('#defaultForm').bootstrapValidator({         message: 'This value is not valid',  feedbackIcons: {         valid: 'glyphicon glyphicon-ok',         invalid: 'glyphicon glyphicon-remove',         validating: 'glyphicon glyphicon-refresh'          }, fields: { name1: { message: '姓名验证失败', validators: { notEmpty: { message: '姓名不能为空' }, regexp: { regexp: /^[\u2E80-\u9FFF]+$/,//只输汉字 message: '请输入汉字' } } }, name2: { validators: { notEmpty: { message: '姓名不能为空' }, regexp: { regexp: /^[\u2E80-\u9FFF]+$/,//只输汉字 message: '请输入汉字' } } }, phone1: { validators: { notEmpty: { message: '手机号不能为空' }, regexp: { regexp: /^1[34578]\d{9}$/, message: '请查看手机号是否输入完整或是否是合法号码' } } }, product1: { validators: { notEmpty: { message: '产品名称不能为空' }, regexp: { regexp: /^[A-Za-z0-9\u4e00-\u9fa5\.,。]+$/,//^[\u2E80-\u9FFF]+$指数汉字 message: '请输入汉字、字母、数字中文逗号句号' } } }, message0: { validators: { notEmpty: { message: '留言不能为空' }, regexp: { regexp: /^[A-Za-z0-9\u4e00-\u9fa5\.,。]+$/,//^[\u2E80-\u9FFF]+$指数汉字 message: '请输入汉字、字母、数字中文逗号句号' } } }, region: { validators: { notEmpty: { message: '所在地区不能为空' }, regexp: { regexp: /^[A-Za-z0-9\u4e00-\u9fa5\.,。]+$/,//^[\u2E80-\u9FFF]+$指数汉字 message: '请输入汉字、字母、数字中文逗号句号' } } }, feedback: { validators: { notEmpty: { message: '产品反馈不能为空' }, regexp: { regexp: /^[A-Za-z0-9\u4e00-\u9fa5\.,。]+$/,//^[\u2E80-\u9FFF]+$指数汉字 message: '请输入汉字、字母、数字中文逗号句号' } } }, } }); });