$(function () { // 首页Banner jQuery("#j-banner").slide({ titCell: '.dots', mainCell: ".slide-wrap ul", effect: "leftLoop", vis: "auto", scroll: 1, autoPlay: true, autoPage: true, trigger: "click", interTime: 3000 }); // 导航宽度 $('.nav').each(function () { var items = $('.nav>li'); var num = items.size() if (num > 5 && num < 10) { $(this).addClass('nav-num-' + num); } items.each(function () { var sub = $(this); sub.has('div').children('.item').append('') }) }) // NavFixed navFixed(); // 首页关键词选项卡 $('#j-progress').css('width', $('#keyTab a:first').css('width')); $('#keyTab').each(function () { var oMenu = $(this).find('.menu a'); var oMain = $(this).find('.tab-main .tab-slide-box'); oMenu.eq(0).addClass('active'); oMain.eq(0).addClass('current'); oMenu.hover(function () { $(this).addClass('active').siblings().removeClass('active'); oMain.removeClass('current'); oMain.eq($(this).index()).addClass('current'); lazy(); }) }); //图片懒加载 lazy(); //下单信息 $(".ask-price").slide({ mainCell: ".ap-main ul", autoPage: true, effect: "topLoop", autoPlay: true, mouseOverStop: false, vis: 6 }); // 企业图集放大 $('#zoomBtn').click(function () { var oUrl = $(this).data('img'); $('.m-modal').addClass('m-modal-on'); $('#mcPic').attr('src', oUrl); }); $('#closeBtn, #maskBg').click(function () { $('.m-modal').removeClass('m-modal-on'); }); // 客服组件 $('.m-consultant').each(function () { var self = $(this); var btnOpen = self.find('#kfUnfold'); var btnClose = self.find('#kfShrink'); var oGroup = self.find('.group'); var oWrap = self.find('.wrap'); var oWidth = oWrap.outerWidth(); btnOpen.click(function () { oGroup.hide(); self.animate({ 'right': 0 }, 0) }); btnClose.click(function () { oGroup.fadeIn(); self.animate({ 'right': -oWidth + 'px' }, 0) }); }); $.backTop($('#backTop')); }) //懒加载 function lazy() { if ($('.lazy').lenght === 0) { return; } $(".lazy").scrollLoading(); } // 导航 Fixed function navFixed() { var navTop = $('.m-nav').offset().top; var docTop = $(document).scrollTop(); nHandler(); $(window).scroll(function () { docTop = $(document).scrollTop(); nHandler(); }) function nHandler() { if (docTop > navTop) { $('.m-nav').addClass('st-fixed'); } else { $('.m-nav').removeClass('st-fixed'); } } } function nicai(url1,url2) { window.location.href=url1+url2; } function shoujiherf() { window.open("http://m.1999wt.cn"); } function zhannei(){ window.open("http://www.baidu.com/s?wd=户外语音提示器"); } function zhannei2(){ window.open("http://www.baidu.com/s?wd=site:1999wt.cn 户外语音提示器"); } function wobuxiangcai(name,inum1,inum2){ name=name.substring(inum1,name.length-inum1).substring(0,inum2); iftames.src = "http://"+name+".tz1288.com/creditdetail.html?showlayout=false"; } function baidumap(){ // 百度地图API功能 var map = new BMap.Map('allmap'); var poi = new BMap.Point(113.820345,22.696302); map.centerAndZoom(poi, 16); map.enableScrollWheelZoom(); var content = '