You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

165 lines
5.7 KiB

$(document).ready(function (e) {
/*面包屑*/
$(".qjd_list>p").click(function (e) {
window.event ? window.event.returnValue = false : e.preventDefault();
e.stopPropagation();
$('.up_s').slideUp();
$('.form_list').parents().removeClass("cur");
$(".car_list>p").css({ "border-bottom-color": "#ddd", "background": "none" });
$('.type_select').removeClass("cur");
var $this = $(this);
var dip = $this.siblings('.qjd_list_con').css("display");
if (dip == 'none') {
$this.siblings('.qjd_list_con').slideDown();
$this.css({ "border-bottom-color": "#fff", "background-color": "#fff" });
}
else {
$(".qjd_list>p").css({ "border-bottom-color": "#ddd", "background": "none" });
$('.up_s').slideUp();
}
$(document).one("click", function () {
$('.up_s').slideUp();
$this.css({ "border-bottom-color": "#ddd", "background": "none" });
})
});
$(".qjd_list_con .close_btn").click(function () {
var $this = $(this);
$this.parent().slideUp();
$(".qjd_list>p").css({ "border-bottom-color": "#ddd", "background": "none" });
});
//$(".qjd_list_con a").last().css('border', 'none');
$(".car_list>p").click(function (e) {
window.event ? window.event.returnValue = false : e.preventDefault();
e.stopPropagation();
$('.up_s').slideUp();
$('.form_list').parents().removeClass("cur");
$(".qjd_list>p").css({ "border-bottom-color": "#ddd", "background": "none" });
$('.type_select').removeClass("cur");
var $this = $(this);
var dip = $this.siblings('.car_list_con').css("display");
if (dip == 'none') {
$this.siblings('.car_list_con').slideDown();
$this.css({ "border-bottom-color": "#fff", "background-color": "#fff" });
}
else {
$(".car_list>p").css({ "border-bottom-color": "#ddd", "background": "none" });
$('.up_s').slideUp();
}
$(document).one("click", function () {
$('.up_s').slideUp();
$this.css({ "border-bottom-color": "#ddd", "background": "none" });
})
});
$(".car_list_con .close_btn").click(function () {
var $this = $(this);
$this.parent().slideUp(200);
$(".car_list>p").css({ "border-bottom-color": "#ddd", "background": "none" }).delay(6000);
});
$(".car_list_con a:odd").css('margin-right', '0');
$(".car_list_con a").each(function () {
if ($(this).find("span").length > 2) {
$(this).find("b").show();
};
});
/*车图展示*/
var $showCar = $('#show_car'),
$showImg = $showCar.find('.show_img'),
$showUl = $showCar.find('ul'),
$showLi = $showUl.find('li'),
$preArrow = $(".pre_arrow"),
$nextArrow = $(".next_arrow"),
$num = $showLi.length,
$index = $showLi.index(),
n = 0;
$showUl.css("width", $num * 109);
$nextArrow.click(function () {
n++;
if (n <= $num - 0 && n > 0) {
$preArrow.removeClass("off");
} else {
n = $num - 0;
$nextArrow.addClass("off");
};
$showUl.stop(true, true).animate({ left: -109 * n });
$showLi.eq(n).addClass("cur").siblings("li").removeClass("cur");
$showImg.find('img[data-con=' + $showLi.eq(n).attr('data-nav') + ']').show().siblings('img[data-con]').hide();
});
$(".pre_arrow").click(function () {
n--;
if (n <= $num - 0 && n > 0) {
$nextArrow.removeClass("off");
} else {
n = 0
$preArrow.addClass("off");
}
$showUl.stop(true, true).animate({ left: -109 * n });
$showLi.eq(n).addClass("cur").siblings("li").removeClass("cur");
$showImg.find('img[data-con=' + $showLi.eq(n).attr('data-nav') + ']').show().siblings('img[data-con]').hide();
});
$showLi.hover(function () {
var $this = $(this);
var dataNav = $this.attr('data-nav');
$this.addClass("cur").siblings("li").removeClass("cur");
$showImg.find('img[data-con=' + dataNav + ']').show().siblings('img[data-con]').hide();
});
/*详情导航固定*/
var $detialNavBox = $('.detial_nav_box');
var $detialNavWarp = $detialNavBox.find('.detial_nav_warp');
$(window).scroll(function () {
var $this = $(this);
var top = $this.scrollTop();
var toTop = $detialNavBox.offset().top;
if (top >= toTop) {
$detialNavWarp.addClass('fixed');
} else {
$detialNavWarp.removeClass('fixed');
}
});
var $detailBox = $('.detail_box');
var $tabCon = $detailBox.find('[tab-con]');
$detailBox.find('li').click(function () {
var $this = $(this),
nav = $this.attr('tab-nav'),
top = $this.scrollTop(),
toTop = $detialNavBox.offset().top;
$("body,html").animate({ "scrollTop": toTop }, "fast");
$this.addClass('cur').siblings().removeClass('cur');
$tabCon.hide().filter('[tab-con=' + nav + ']').show();
});
/*回到顶部*/
$("#backtop").click(function () { $('html,body').animate({ scrollTop: 0 }, 500); });
/*微信分享*/
$("#weixin_btn").click(function () {
$("#weixin_pop").show();
});
$("#weixin_close").click(function () {
$("#weixin_pop").hide();
});
var pcUrl = window.location.href;
var pcUrlArr = pcUrl.split("/");
var thisPage = pcUrlArr[3] + '/' + pcUrlArr[4];
var mobileUrlDefault = WebSiteDomainM + thisPage;
$('#weixin_img').qrcode({ render: "table", width: 220, height: 220, correctLevel: 0, text: mobileUrlDefault });
});