$(function(){ $('.my_nav li').mouseover(function(){ $(this).children('.dropdown-menu').stop().slideDown(200); }) $('.my_nav li').mouseout(function(){ $(this).children('.dropdown-menu').stop().slideUp(200) }) $('.header_btn').on('click',function(){ $('.m_header').addClass('fadeInRight').removeClass('fadeOutRight').show() }) $('.m_ke,.tog-k-g').on('click',function(){ $('.m_header').toggleClass('fadeInRight').addClass('fadeOutRight'); }) $('.my_cont').on('click',function(){ window.event? window.event.cancelBubble = true : e.stopPropagation(); }) $('.new_header a').on('click',function(){ $(this).addClass('tog_a').siblings().removeClass('tog_a') $('.new_body_tog').eq($(this).index()).show().siblings().hide() }) $('.anli_title li').on('click',function(){ $(this).addClass('tog_a anli_wap_a').siblings().removeClass('tog_a anli_wap_a'); $('.anli_body ul').eq($(this).index()).show().siblings().hide(); }) $('.i_v_c_top li').on('click',function(){ $(this).addClass('tog_a').siblings().removeClass('tog_a'); $('.i_v_c_bottom ul').eq($(this).index()+1).show().siblings().hide(); }) $('.videolist_child').each(function(i){ $(this).find('.typenamespan').html($(this).find('.typename').children('a').html()) }) $('.username').bind('focusout change',function(){ btnTog() var regName = /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/; var username = $(this).val(); if(!regName.test(username)){ alertFalse('您输入的姓名有误,请重新输入'); my_alert(); $(this).parent().removeClass('has-success').addClass('has-error'); $('.username').val(''); return false; } else{ alertTrue('恭喜您姓名输入正确') my_alert() $(this).parent().removeClass('has-error').addClass('has-success') var myData = new Date(); console.log(myData.toLocaleString()); $('.mydata').val(myData.toLocaleString()) } }) $('.phone').bind('focusout change',function(){ btnTog() var regPhone = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/; var userPhone = $(this).val(); if(!regPhone.test(userPhone)){ alertFalse('您的手机号码输入有误,请重新输入'); my_alert(); $(this).parent().removeClass('has-success').addClass('has-error'); $('.phone').val(''); return false; }else{ alertTrue('恭喜您手机号输入正确') my_alert() $(this).parent().removeClass('has-error').addClass('has-success') } }) $('.content').bind('keyup focusout change',function(){ btnTog(); if($('.content').val()===''){ alertFalse('请您务必填写案件描述'); my_alert(); $(this).parent().removeClass('has-success').addClass('has-error'); return false; }else{ $(this).parent().removeClass('has-error').addClass('has-success') } }) function btnTog(e){ if($('.username').val()===''){ console.log('姓名输入错误'); $('.my_sub').attr({disabled:"disabled"}) return false } if($('.phone').val()===''){ console.log('手机号输入错误'); $('.my_sub').attr({disabled:"disabled"}) return false } if($('.content').val()===''){ console.log('案件详情输入错误'); $('.my_sub').attr({disabled:"disabled"}) return false } $('.my_sub').removeAttr('disabled') console.log('22222-66'); return true; } http://127.0.0.1/plus/diy.php // 弹出框false function alertFalse(e){ $('.my_alert_cont').addClass('alert-warning').removeClass('alert-success') $('.my_alert_cont span').html(e); } // 弹出框true function alertTrue(e){ $('.my_alert_cont').addClass('alert-success').removeClass('alert-warning') $('.my_alert_cont span').html(e) } // 弹出框动画 function my_alert(){ if($('.my_alert').css('visibility')==='visible'){ return false; } function inAlert(){ function outAlert(){ $('.my_alert').css({ visibility:'hidden', top:'0%', }) window.clearTimeout(outAlertTime); } $('.my_alert').css({ visibility:'visible', top:'3%', }) var outAlertTime = setTimeout(outAlert,4000); window.clearInterval(inAlertTime); } var inAlertTime = setInterval(inAlert, 100); // var outAlert = setTimeout(outAlert(), 4000); } // 弹出框动画结束 // 万博max官网地址团队轮播图JS开始 $('.mylst').slick({ dots: true, infinite: true, speed: 300, slidesToShow: 5, slidesToScroll: 1, autoplay:true, arrows:false, autoplaySpeed:2000, swipeToSlide:true, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 1, dots: true, arrows:false, } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 2, slidesToScroll:2, autoplay:true, arrows:false, dots: true, } } ] }); // 万博max官网地址团队轮播图JS结束 // 侧边万博max官网地址团轮播 $('.gong_lunbo').animate(0,2000,"swing") $('.gong_lunbo').bxSlider({ mode:'vertical', auto: true, infiniteLoop:true, controls:false, pager:false, minSlides:4, moveSlides:1, keyboardEnabled:false, preloadImages:'all', speed:1800, autoHover:true, useCSS:false }); // 侧边万博max官网地址团轮播结束 //wapdaohang var waptitleICON = [ 'icon-mo', 'icon-ribao', 'icon-tuandui', 'icon-chehui', 'icon-renwu', 'icon-shipin', 'icon-ditu' ] $('.m_dh_cont li').each(function(){ $(this).find('.iconfont').addClass(waptitleICON[$(this).index()-1]); // console.log(); // console.log(waptitleICON[$(this).index()-1]); }) //wapdaohangENd $('.carousel-inner .item').eq(0).addClass('active') // 返回顶部 function setlayer(alias, str, icon) { var html = ""; if (alias == "text") { html += "
"; html += ""; html += "" + str + ""; html += "
"; } else { html += "
"; html += ""; html += "
"; } return html; } $(function () { $(".leftNav-item li").hover(function (e) { var alias = $(this).attr("lay-data"); var str = $(this).attr("data-fooc"); var icon = $(this).children("i").attr("class"); if (!alias) { return false; } $(this).append(setlayer(alias, str, icon)); $(this).children("div").show(300); }, function (e) { $(this).children("div").remove(); }); $(window).scroll(function () { var scrollTop = $(document).scrollTop(); if (scrollTop >= 200) { $(".for-top").show(); } else { $(".for-top").hide(); } }); $(".for-top").click(function () { console.log("Are You Ok?"); $('html,body').animate({ scrollTop: 0 }, 700); }) }) // 返回顶部结束 })