$(document).ready(function (e) { // 初始化wow new WOW().init(); $.fn.extend({ animateCss: function (animationName) { var animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend"; $(this) .addClass("animated " + animationName) .one(animationEnd, function () { $(this).removeClass("animated " + animationName); }); }, }); // 菜单定位 $(document).scroll(function () { var numberMove = $(this).scrollTop(); // console.log(numberMove) if (numberMove < 250) { $("#header").addClass("header-wrapper"); $("#header").removeClass("header-wrapper2"); // $(".group-profile-wrapper").css({'margin-top':'280px'}) } else { $("#header").removeClass("header-wrapper"); $("#header").addClass("header-wrapper2"); // $(".group-profile-wrapper").css({'margin-top':'70px'}) } }); // console.log('高度',window.screen.height) // console.log('宽度',window.screen.width) var scH = window.screen.height; $("#iframe").css("height", scH + "px"); //弹出框顶部位置 var societyDutyTxt = $(".society-duty-txt").height(); var societyDutyTxtH = societyDutyTxt + 10; $(".society-duty-txt-bg").css("margin-top", -societyDutyTxtH + "px"); // 导航 $(function () { $(".nav li").hover(function () { // $(".nav li a").css({"border-bottom":"none","padding-bottom":"0"}); // $(this).find("a").css({"border-bottom":"2px solid #fff","padding-bottom":"9px"}); $(".h_right .nav li a").removeClass("active"); $(this).find("a").addClass("active"); var i = $(this).index(); console.log("i", i); // if (i != 0 || i != 5) { // console.log('i 非等 0') // $("#subNav_box .item").removeClass('curr'); // $("#subNav_box .item").eq(i).addClass('curr'); // $("#subNav_box").addClass("on"); // } else { // // $("#subNav_box .item").removeClass('curr'); // $("#subNav_box").removeClass("on"); // } if (i == 0 || i == 5 || i == 7) { $("#subNav_box .item").removeClass("curr"); $("#subNav_box").removeClass("on"); } else { $("#subNav_box .item").removeClass("curr"); $("#subNav_box .item").eq(i).addClass("curr"); $("#subNav_box").addClass("on"); } }); $("#header").hover( function () {}, function () { // $(".nav li a").css({"border-bottom":"none","padding-bottom":"0"}); // $(".nav li.on a").css({"border-bottom":"2px solid #fff","padding-bottom":"9px"}); $(".nav li a").removeClass("active"); $(".nav li.on a").addClass("active"); $("#subNav_box .item").removeClass("curr"); $("#subNav_box").removeClass("on"); } ); // console.log('宽度',window.screen.width) var pcW = window.screen.width; console.log("w", pcW); $("#subNav_box .item").each(function () { var i = $(this).index(); var le = $(".nav li").eq(i).position().left; // console.log('le',le) if (i == 1) { if (pcW == 1920) { $(this).css("left", le + 370); } else if (pcW == 1600) { $(this).css("left", le + 200); } else if (pcW == 1440) { $(this).css("left", le + 120); } else if (pcW == 1366) { $(this).css("left", le + 90); } else if (pcW <= 1280) { $(this).css("left", le + 40); } else { console.log("eee111"); $(this).css("left", le + 200); } } else if (i == 2) { if (pcW == 1920) { $(this).css("left", le + 340); } else if (pcW == 1440) { $(this).css("left", le + 140); } else if (pcW == 1366) { $(this).css("left", le + 100); } else if (pcW <= 1280) { $(this).css("left", le + 50); } else { $(this).css("left", le + 200); } } else if (i == 3) { if (pcW == 1920) { $(this).css("left", le + 340); } else if (pcW == 1440) { $(this).css("left", le + 140); } else if (pcW == 1366) { $(this).css("left", le + 100); } else if (pcW <= 1280) { $(this).css("left", le + 50); } else { $(this).css("left", le + 200); } } else if (i == 4) { if (pcW == 1920) { $(this).css("left", le); console.log("eee"); } else if (pcW == 1440) { $(this).css("left", le - 250); } else if (pcW == 1366) { $(this).css("left", le - 250); } else if (pcW <= 1280) { $(this).css("left", le - 270); } else { $(this).css("left", le - 150); } } else if (i == 6) { // i== 6 在线商店 if(pcW == 1920){ $(this).css("left", le+300); }else if(pcW== 1600){ console.log('zheli') $(this).css("left", le); }else if(pcW== 1440){ $(this).css("left", le-180); } else if(pcW == 1366){ $(this).css("left", le-180); }else if(pcW == 1280){ $(this).css("left", le-180); }else{ $(this).css("left", le); } } else { $(this).css("left", le + 200); } }); // showNav() // 导航栏定位 // 导航栏定位 function showNav() { var urlstr = location.href; var urlstatus = false; $(".nav li a").each(function () { if ( (urlstr + "/").indexOf($(this).attr("href")) > -1 && $(this).attr("href") != "" ) { $(this).parent().addClass("on").siblings("li").removeClass("on"); urlstatus = true; } else { $(this).parent().removeClass("on"); urlstatus = false; } }); } }); // 在线商店 $("#pdd-hover").hover(function (){ $("#shop-qrcode-box-dd").show() },function(){ $("#shop-qrcode-box-dd").hide() }) // 微信小程序 $("#wx-shop").hover(function (){ $("#wx-xiaocx").show() },function(){ $("#wx-xiaocx").hide() }) // 返回上一页 $("#goBack").click(function () { history.back(-1); }); // 介绍切换 var num = 0; $(".news-ul-sec .nav-item-wrapper:not(:first)").hide(); $(".news-ul-first .news-li").hover(function () { num = $(this).index(); $(this).addClass("active-li").siblings().removeClass("active-li"); $(".news-ul-sec") .children("li:eq(" + num + ")") .show() .siblings() .hide(); /*遍历每个节点children*/ }); // 新闻媒体切换菜单 var news_curr = 0; $(".news-media-wrapper .news-media-item-content:not(:first)").hide(); $("#news-media-tab-item-box .news-tab-item").click(function () { news_curr = $(this).index(); $(this) .addClass("news-tab-item-active") .siblings() .removeClass("news-tab-item-active"); $(".news-media-wrapper") .children(".news-media-item-content:eq(" + news_curr + ")") .show() .siblings() .hide(); /*遍历每个节点children*/ }); // 城市开发楼盘切换 var i_city = 0; $(".city-houses-tab-content .houses-tab-content:not(:first)").hide(); $(".city-houses-tab .houses-tab-item").click(function () { i_city = $(this).index(); $(this) .addClass("city-item-acitve") .siblings() .removeClass("city-item-acitve"); $(".city-houses-tab-content") .children(".houses-tab-content:eq(" + i_city + ")") .show() .siblings() .hide(); /*遍历每个节点children*/ }); // 塞班岛线路检测中心二级 菜单中距物业菜单切换 var i_estate = 0; $( ".real-estate-content-wrapper .real-estate-content-item:not(:first)" ).hide(); $(".real-estate-wrapper .real-estate-item").click(function () { i_estate = $(this).index(); $(this) .addClass("real-estate-item-active") .siblings() .removeClass("real-estate-item-active"); $(".real-estate-content-wrapper") .children(".real-estate-content-item:eq(" + i_estate + ")") .show() .siblings() .hide(); /*遍历每个节点children*/ }); // 放大图片 window.onscroll = function () { var sl = -Math.max( document.body.scrollTop, document.documentElement.scrollTop ); //document.getElementsByClassName('layui-m-layerchild').style.Top = sl + 'px'; // $(".pop-box").css("top", sl + "px"); // $(".pop-bg").css("top", sl + "px"); }; $("#floor-plan .floor-plan-item .icon-floor").click(function () { var path = $(this).siblings(".floor-plan-img").attr("src"); $(".pop-box").css({ display: "block" }); $(".hint-pic").attr("src", path); }); $(".gb-icon").click(function () { $(".pop-box").css({ display: "none" }); }); // 添加表单 var parentDom = $("#visit-box-wrapepr"); var oriDom = parentDom.children(":first"); $(".add-btn").click(function () { var nowDom = oriDom.clone(true); parentDom.append(nowDom); }); // 删除按钮事件 $(".editdelete").on("click", function () { console.log(999); $(this).parent().remove(); }); // 删除测试 // $('.add-btn').click(function(){ // // var nowDom=oriDom.clone(true); // parentDom.append('