$(function(){ //鑿滃崟鏍忚剼鏈 $('.dropdown-menu dd').on('mouseover', function(){ $('.menuimg').attr('src', '/uploads/images/ads/02.jpg'); $('.menutxt').text($(this).text()); }); $('.dropdown-menu dd').on('mouseleave', function(){ $('.menuimg').attr('src', '/uploads/images/ads/01.jpg'); $('.menutxt').text('鑺瓨涓囪薄锛岃嚧缇庡敮鐪?); }); $('.s-close').click(function(){ $('.index-search').slideUp('easeInOutBounce'); }); $('.opensou').click(function(){ $('.index-search').slideDown('slow'); }); $('.gosearch').click(function(){ var srhval = $(this).parents('form').find('input[name="Keyword"]').val(); if(srhval == ''){ alert('鍏抽敭璇嶄笉鑳戒负绌?); } else { $(this).parents('form').submit(); } }); $(".nav .dropdown-menu").click(function(e) { e.stopPropagation(); }); $(".nav .dropdown").hover(function() { $(this).siblings().find('[aria-expanded="true"]').dropdown("toggle"); $(this).find(".dropdown-toggle").dropdown("toggle"); }); $('.itemrow .col:eq(1)').find('dl:eq(2)').appendTo($(".itemrow .col").last()); $('.sol_item .col:eq(0)').after('
 
').find('dd:gt('+ Math.floor($('.sol_item .col:eq(0) dd').length/2) +')').appendTo($('.sol_item .col:eq(0)').next().find('dl')); $('.sol_item .col:eq(2)').after('
 
').find('dd:gt('+ Math.floor($('.sol_item .col:eq(2) dd').length/2) +')').appendTo($('.sol_item .col:eq(2)').next().find('dl')); $(document).ready(function(){ $(document).off('click.bs.dropdown.data-api'); }); //璋冩暣姣斾緥 const detectZoom = () => { let ratio = 0, screen = window.screen, ua = navigator.userAgent.toLowerCase(); if (window.devicePixelRatio !== undefined) { ratio = window.devicePixelRatio; } else if (~ua.indexOf('msie')) { if (screen.deviceXDPI && screen.logicalXDPI) { ratio = screen.deviceXDPI / screen.logicalXDPI; } } else if ( window.outerWidth !== undefined && window.innerWidth !== undefined ) { ratio = window.outerWidth / window.innerWidth; } if (ratio) { ratio = Math.round(ratio * 100); } return ratio; }; /*$(window).resize(function(){ const m = detectZoom(); if(m > 150 && $(window).width() > 1900){ } else { if($(window).width() > 1200){ $('.index-header').css('zoom', 100 / Number(m)); $('.qqservice').css('zoom', 100 / Number(m)); } } var navw = $('.nav').width(); var maxw = 0; $.each($('.nav-item'), function(k, v){ maxw += $(v).width(); if(navw < maxw && navw != maxw){ $(v).hide(); } else { $(v).show(); } }); console.log($(window).width()); //console.log(navw + '---' + maxw); }); $(window).resize();*/ $('.phone-menu').click(function(){ if($(this).find('.fa-bars').length == 1){ $(this).html(''); 銆€$('.index-header').addClass('h-fixed'); } else { $(this).html(''); if($(document).scrollTop() < 200){ $('.index-header').removeClass('h-fixed'); } } }); $('.phone-back').click(function(){ window.history.back(); }); if(document.referrer == ''){ $('.phone-back').hide(); } else { $('.phone-back').show(); } $(window).scroll(function(){ 銆€銆€if($(document).scrollTop() > 200 || $('.phone-menu .fa-close').is(':visible')){ 銆€銆€銆€銆€$('.index-header').addClass('h-fixed'); 銆€銆€} else { 銆€銆€銆€銆€$('.index-header').removeClass('h-fixed'); 銆€銆€} }); /*$('#gushibox').on('load', function() { var contentHeight = $(this).contents().height(); $(this).height(contentHeight); });*/ });