$(window).load(function () {
function configIframe(){
/*首页产品滚动*/
var w=$(window).width();
var vis=4;
if(w>=1200){
vis=4;
}else if(w<=1199 && w>880) {
vis=3;
}else if(w<=880 && w>380) {
vis=2;
}else if(w<=380){
vis=2;
}
var pro_bdW=$('.product .bd').width();
var pro_LiW=(pro_bdW-30*vis)/vis;
$('.product .bd li').width(pro_LiW);
//document.getElementById("swidth").innerHTML=vis;
jQuery(".product").slide({
mainCell:".bd ul",
autoPage:true,
effect:"left",
autoPlay:false,
vis:vis,
trigger:"click"
});
}
configIframe();
/*窗口改变事件*/
window.onresize = function () {
/*window.location.reload();*/
configIframe();
}
//移动端展开nav
$('#navToggle').on('click',function(){
$('#nav').addClass('open');
})
//关闭nav
$('#nav .top .closed').on('click',function(){
$('#nav').removeClass('open');
})
//二级导航 移动端
/*$(".m_nav .ul li").click(function() {
$(this).children("div.dropdown_menu").slideToggle('slow')
$(this).siblings('li').children('.dropdown_menu').slideUp('slow');
});*/
});
$(function(){
$('.topBar .s').hover(function(){
$(this).find('.sub').stop().slideToggle();
});
});
if ($(window).width() > 991) {
$('.dropdown').hover(function () {
$(this).addClass('open');
}, function () {
$(this).removeClass('open');
});
} else {
$('.dropdown').find('.arr').on('click', function () {
$(this).parent().toggleClass('open');
});
}
$('.lanmu').find('.arr').on('click', function () {
$(this).parent().toggleClass('open');
});
/*联系方式tab切换*/
$(".contact .tags_title .one").hover(function(){
$(this).removeClass('ron');
$(".contact .tags_title .two").addClass('ron');
$(".contact .content2").hide();
$(".contact .content1").show();
},function(){
});
$(".contact .tags_title .two").hover(function(){
$(this).removeClass('ron');
$(".contact .tags_title .one").addClass('ron');
$(".contact .content1").hide();
$(".contact .content2").show();
},function(){
});
/* -----QQ 侧边悬浮 ---- */
$( ".suspension .a").bind("mouseenter", function(){
var _this = $(this);
var s = $(".suspension");
var isService = _this.hasClass("a-service");
var isServicePhone = _this.hasClass("a-service-phone");
var isQrcode = _this.hasClass("a-qrcode");
if(isService){ s.find(".d-service").show().siblings(".d").hide();}
if(isServicePhone){ s.find(".d-service-phone").show().siblings(".d").hide();}
if(isQrcode){ s.find(".d-qrcode").show().siblings(".d").hide();}
});
$(".suspension, .suspension .a-top").bind("mouseleave", function(){
$(".suspension").find(".d").hide();
});
$(".suspension .a-top").bind("mouseenter", function(){
$(".suspension").find(".d").hide();
});
$(".suspension .a-top").bind("click", ".suspension .a-top", function(){
$("html,body").animate({scrollTop: 0});
});
$(window).scroll(function(){
var st = $(document).scrollTop();
var $top = $(".suspension .a-top");
if(st > 400){
$top.css({display: 'block'});
}else{
if ($top.is(":visible")) {
$top.hide();
}
}
});
//首页banner下面的服务支持
$(".bussiness-body .item").mouseover(function(){
$(this).addClass("on").siblings().removeClass("on");
});
//手机标题轮播
var mySwiper = new Swiper('.mobilenewslist', {
//direction: 'vertical',
// loop: true,
slidesPerView: 'auto'
})
/*手机下拉固定头部*/
$(function(){
var nav=$("#site_top"); //得到导航对象
var win=$(window); //得到窗口对象
var sc=$(document);//得到document文档对象。
win.scroll(function(){
if(sc.scrollTop()>0){
nav.addClass("fixednav");
}else{
nav.removeClass("fixednav");
}
})
})
/*搜索*/
$(function() {
$(".select_box").click(function(event) {
event.stopPropagation();
$(this).find(".option").toggle();
$(this).parent().siblings().find(".option").hide();
});
$(document).click(function(event) {
var eo = $(event.target);
if ($(".select_box").is(":visible") && eo.attr("class") != "option" && !eo.parent(".option").length)
$('.option').hide();
});
$(".option li").click(function() {
var check_value = $(this).text();
var zlValue = $('.option li:eq(1)').html();
var bqValue = $('.option li:eq(2)').html();
$(this).parent().siblings(".select_txt").text(check_value);
$("#select_value").val(check_value);
$('#searchPlaceholder').prop('placeholder', $(this).attr('rel'));
$('#sousuotype').val($(this).attr('data'));
});
})
/*展开搜索框*/
$('#searchnr').on('hover',function(){
$('#searchbox').addClass('show');
$('#searchbox').addClass('animated2');
$('#searchbox').addClass('slideInUp');
})
//关闭搜索框
$('#searchbox .closed').on('click',function(){
$('#searchbox').removeClass('show');
$('#searchbox').removeClass('animated2');
$('#searchbox').removeClass('slideInUp');
})
//样式展开
new WOW().init();
//首页banner
var mySwiper = new Swiper('.indexbanner', {
loop: true,
autoplay: 7000,
speed: 300,
paginationClickable: true,
pagination: '.swiper-pagination',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
});
/*产品展开*/
$('#productnr').on('click',function(){
$('.lanmu').addClass('show');
})