(function($) { var lilength = $(".product-list ul li").length; if (lilength <= 12) { var Lihheight = 0; } else{ var Lihheight = $(".product-list ul li").innerHeight(); } $.fn.myScroll = function(options) { var defaults = { speed: 40, rowHeight: Lihheight }; var opts = $.extend({}, defaults, options), intId = []; function marquee(obj, step) { obj.find("ul").animate({ marginTop: '-=1' }, 0, function() { var s = Math.abs(parseInt($(this).css("margin-top"))); if (s >= step) { $(this).find("li").slice(0, 3).appendTo($(this)); $(this).css("margin-top", 0); } }); } if(screen.width <= 1024){ function marquee(obj, step) { obj.find("ul").animate({ marginTop: '-=1' }, 0, function() { var s = Math.abs(parseInt($(this).css("margin-top"))); if (s >= step) { $(this).find("li").slice(0, 2).appendTo($(this)); $(this).css("margin-top", 0); } }); } } this.each(function(i) { var sh = opts["rowHeight"], speed = opts["speed"], _this = $(this); intId[i] = setInterval(function() { if (_this.find("ul").height() <= _this.height()) { clearInterval(intId[i]); } else { marquee(_this, sh); } }, speed); _this.hover(function() { clearInterval(intId[i]); }, function() { intId[i] = setInterval(function() { if (_this.find("ul").height() <= _this.height()) { clearInterval(intId[i]); } else { marquee(_this, sh); } }, speed); }); }); } })(jQuery); var Inum = $(".qiye_n_main .qiye_editor img").length; if (Inum==1) { $(".qiye_n_main .qiye_editor p").css({"width":"100%"}) } if (Inum==2) { $(".qiye_n_main .qiye_editor p").css({"width":"50%"}) } if (Inum==3) { $(".qiye_n_main .qiye_editor p").css({"width":"33.33%"}) } if (Inum==4) { $(".qiye_n_main .qiye_editor p").css({"width":"25%"}) } if (Inum==5) { $(".qiye_n_main .qiye_editor p").css({"width":"20%"}) } if (Inum==6) { $(".qiye_n_main .qiye_editor p").css({"width":"33.33%"}) } $('.p-button').click(function(){ if ($('.qiye_product_left').hasClass('p-click')) { $('.qiye_product_left').removeClass('p-click') $('.p-button p').html('查看更多>>') $('.qiye_product').css({"position":"relative"}) } else{ $('.qiye_product_left').addClass('p-click') $('.p-button p').html('<<收起分类') $('.qiye_product').css({"position":"relative"}) } }) var pimg = $(".qiye_editor p").width(); $(".qiye_editor p img").css({"height": pimg * 0.70 +'px'}); $(".qiye_one ul p").wrap("
  • ").addClass(''); var neiimg = $(".qiye_product_list li").width(); $(".qiye_product_list li img").css({"height": neiimg * 0.8 +'px'}) if($(".company-profile span:has(img)").length){ $('.company-profile span img').css({"min-height":"100%","width":"100%","display":"block"}) }else{ $('.company-profile span').css({"display":"none"}) $('.company-profile p').css({"float":"none","width":"100%","padding":"0"}) $('.company-profile a').css({"margin-left":"0","float":"none"}) } $('.qiye_tab-title .qiye_title-item').click(function() { var $this = $(this); $(this).addClass('active').siblings('.qiye_tab-title .qiye_title-item').removeClass('active'); $('.friendship-links').eq($this.index()).addClass('active').siblings('.friendship-links').removeClass('active'); }); $(".qiye_htop").click(function() { $('body,html').animate({ scrollTop: 0 }, 600); }) $(document).bind("contextmenu",function(){return false;}); $('.qiye_mbutton').click(function(){ if ($(this).hasClass("menu-open")) { $('.mainNav').slideUp(); $(this).removeClass('menu-open') } else{ $('.mainNav').slideDown(); $(this).addClass('menu-open') } }) var box0 = $(".qiye_one"), v0 = 1;var box1 = $(".two"), v1 = 1; Rin(box0, v0); Rin(box1, v1); function Rin($Box, v) {var $Box_ul = $Box.find("ul"), $Box_li = $Box_ul.find("li"), $Box_li_span = $Box_li.find("span"), left = 0, s = 0, timer; $Box_li.each(function(index) { $($Box_li_span[index]).width($(this).width());s += $(this).outerWidth(true);}) window.requestAnimationFrame = window.requestAnimationFrame || function(Tmove) { return setTimeout(Tmove, 1000 / 60) }; window.cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; if (s >= $Box.width()) {$Box_li.clone(true).appendTo($Box_ul); Tmove(); function Tmove() { left -= v; if (left <= -s) { left = 0; $Box_ul.css("left", left) } else { $Box_ul.css("left", left) } timer = requestAnimationFrame(Tmove); } $Box_ul.hover(function() { cancelAnimationFrame(timer) }, function() { Tmove() }) } } $(function(){ var windowWidth = $(window).width(); let productLeftWidth = $('.qiye_dt_left').innerWidth(); let productLeftHeight = $('.qiye_dt_left').innerHeight(); $('.viewBigPic img').css({'display':'block'}); if (windowWidth > 768) { $('.qiye_det_top').css({'position':'relative'}); $('.viewBigPic').css({'position':'absolute','left':productLeftWidth+10+'px','top':'0','width':productLeftWidth+'px','height':productLeftHeight+'px','overflow':'hidden','background':'#fff','z-index':'9'}).hide(); $('.viewBigPic img').css({'display':'block','position':'absolute'}); $('.qiye_dt_left').css({'position':'relative'}); $('.viewBigSolid').css({'position':'absolute','width':'70px','background':'rgba(255,255,255,.4)','height':'70px','z-index':'9','border':'1px solid rgba(255,255,255,1)'}).hide(); window.addEventListener('load', function () { var boxWrap = $('.qiye_det_top'); var box = document.querySelector('.qiye_dt_left'); var yy = document.querySelector('.viewBigSolid'); var big = document.querySelector('.viewBigPic'); box.addEventListener('mouseover', function () { yy.style.display = 'block'; big.style.display = 'block'; let activeViewPic = $('.qiye_dt_left img').attr('src'); $('.viewBigPic img').attr('src',activeViewPic); }); box.addEventListener('mouseout', function () { yy.style.display = 'none'; big.style.display = 'none'; }); box.addEventListener('mousemove', function (e) { var x = e.pageX - boxWrap.offset().left; var y = e.pageY - boxWrap.offset().top; var width = x - yy.offsetWidth / 2; var height = y - yy.offsetHeight / 2; if (width <= 0) { width = 0; } else if (width >= box.offsetWidth - yy.offsetWidth) { width = box.offsetWidth - yy.offsetWidth; } if (height <= 0) { height = 0; } else if (height >= box.offsetHeight - yy.offsetHeight) { height = box.offsetHeight - yy.offsetHeight; } yy.style.left = width + 'px'; yy.style.top = height + 'px'; var bigimg = document.querySelector('.viewBigPic>img'); var bigx = width * (bigimg.offsetWidth - big.offsetWidth) / (box.offsetWidth - yy.offsetWidth); var bigy = height * (bigimg.offsetHeight - big.offsetHeight) / (box.offsetHeight - yy.offsetHeight); bigimg.style.left = -bigx + 'px'; bigimg.style.top = -bigy + 'px'; }); }); }; })