if ($(".v30-contact").length > 0) { $(".v30-contact-in:not(.v30-contact-search)").on("mouseenter", function() { $(this).addclass("cur").siblings(".v30-contact-in").removeclass("cur"); $(".v30-contact-search").removeclass("cur"); $(".v30-contact-search").find(".v30-contact-form").removeclass("cur"); }).on("mouseleave", function() { $(this).removeclass("cur"); }); $(".v30-contact-search").on("mouseenter", function() { $(this).addclass("cur").siblings(".v30-contact-in").removeclass("cur"); settimeout(function() { if ($(".v30-contact-search").hasclass("cur")) {} }, 1000); }).on("mouseleave", function() { if ($(this).find(".v30-contact-form").hasclass("cur")) { return; } else { $(this).removeclass("cur"); } }); $(".v30-contact-search a").on("click", function() { if ($(this).siblings(".v30-contact-form").hasclass("cur")) { $(this).siblings(".v30-contact-form").removeclass("cur"); $(this).parent(".v30-contact-search").removeclass("cur"); } else { $(this).parent(".v30-contact-search").addclass("cur"); $(this).siblings(".v30-contact-form").addclass("cur"); $(this).siblings(".v30-contact-form").find(".float-v30-contact").show(); } }); $(".v30-contact-wx").on("mouseenter", function() { $(this).addclass("cur").siblings(".v30-contact-in").removeclass("cur"); settimeout(function() { if ($(".v30-contact-wx").hasclass("cur")) { $(".v30-contact-qr-show").fadein("fast"); } }, 600); }).on("mouseleave", function() { $(this).removeclass("cur"); $(".v30-contact-qr-show").fadeout("fast"); }); $(".cf-close").on("click", function() { $(this).parents(".v30-contact-search").removeclass("cur"); $(this).parents(".v30-contact-form").removeclass("cur"); }); $(".v30-contact-top").on("click", function() { $("html,body").stop().animate({ scrolltop: 0 }, 500); }); } $(function(){ var nav=$(" .v30-contact"); var win=$(window); var sc=$(document); win.scroll(function(){ if(sc.scrolltop()>=200){ nav.addclass("chnav"); }else{ nav.removeclass("chnav"); } }); });