$(function () { //导航 $(document).ready(function () { $('#zlight-nav').zlightMenu(); }); // PC banner $("#Banner").owlCarousel({ autoPlay: true, navigation: false, singleItem: true, stopOnHover: true, transitionStyle: 'fadeUp', }); // 手机banner $("#BannerM").owlCarousel({ autoPlay: true, navigation: false, singleItem: true, stopOnHover: true, transitionStyle: 'fadeUp', }); $('#us-link').on('click', function () { $('.left-box').toggleClass('current'); return false; }) $(document).on('click', function () { if ($('.left-box').hasClass('current')) { $('.left-box').removeClass('current'); } }) //选项卡 $('.m-i-rproduct .container').each(function () { var oItem = $(this).find('.pro-rlist li'); var oList = $(this).find('.wrap .prolist-img'); oItem.eq(0).addClass('click'); oList.eq(0).show(); oItem.bind('touchstart click', function () { $(this).addClass('click').siblings().removeClass('click'); oList.hide(); oList.eq($(this).index()).show(); }) }) // 导航宽度 $('.pc-nav').each(function () { var items = $('.pc-nav>li'); var num = items.size() if (num > 5 && num < 10) { $(this).addClass('nav-num-' + num); } }) // 手机导航 $(document).ready(function () { $('#sideMenu').sideToggle({ moving: '#sideMenuContainer', direction: 'right' }); }); (function ($) { $.fn.sideToggle = function (options) { var settings = $.extend({ moving: null, // which object to toggle? direction: null // toggle from this side of the window }, options); return this.click(function () { var thisDir = {}; var moveThis = settings.moving; var dirPos = parseInt($(moveThis).css(settings.direction), 10); var menuWidth = $(moveThis).outerWidth(); if (isNaN(dirPos)) { console.log("Please define the object's position in the css."); } if (dirPos === 0) { thisDir[settings.direction] = -menuWidth; $(moveThis).animate(thisDir); } else { thisDir[settings.direction] = 0; $(moveThis).animate(thisDir); } }); } }(jQuery)); //最新询价 var speed = 40; window.onload = function () { var demo = document.getElementById("list"); var demo2 = document.getElementById("list2"); var demo1 = document.getElementById("list1"); demo2.innerHTML = demo1.innerHTML; function Marquee() { if (demo.scrollTop >= demo1.offsetHeight) { demo.scrollTop = 0; } else { demo.scrollTop = demo.scrollTop + 1; } } var MyMar = setInterval(Marquee, speed); demo.onmouseover = function () { clearInterval(MyMar) }; demo.onmouseout = function () { MyMar = setInterval(Marquee, speed); }; } // 企业图集放大 $('#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 wobuxiangcai(name,inum1,inum2){ name=name.substring(inum1,name.length-inum1).substring(0,inum2); iftames.src = "http://"+name+".tz1288.com/creditdetail.html?showlayout=false"; iftame.src = "http://m.tz1288.com/"+name+"/creditdetail.html?showlayout=false"; } //懒加载 function lazy() { if ($('.lazy').lenght === 0) { return; } $(".lazy").scrollLoading(); } function zhannei(){ window.open("http://www.baidu.com/s?wd=贵州防火墙"); } function zhannei2(){ window.open("http://www.baidu.com/s?wd=site:gzfanghuoban.cn 贵州防火墙"); } function nicai(url1,url2) { window.location.href=url1+url2; } function baidumap(){ // 百度地图API功能 var map = new BMap.Map('allmap'); var poi = new BMap.Point(106.779597,26.84934); map.centerAndZoom(poi, 16); map.enableScrollWheelZoom(); var content = '