/*search form*/ function CheckForm(theForm) { var t = $('#search-submita').attr('data-tick'); if(!t) { var t = $('.search-submit-txt').attr('data-tick'); }; var keywords_tick = 'Please enter the keywords'; if(t) { keywords_tick = t; }; if (theForm.keywords.value == "Product Search") { alert(keywords_tick); theForm.keywords.focus(); return false; } else if (theForm.keywords.value == "产品搜索") { alert('请输入关键字'); theForm.keywords.focus(); return false; } else if (theForm.keywords.placeholder == "产品搜索" && theForm.keywords.value == "") { alert('请输入关键字'); theForm.keywords.focus(); return false; } else if (theForm.keywords.placeholder == "输入此处检索" && theForm.keywords.value == "") { alert('请输入关键字'); theForm.keywords.focus(); return false; } else if (theForm.keywords.placeholder == "关键词" && theForm.keywords.value == "") { alert('请输入关键字'); theForm.keywords.focus(); return false; } else if (theForm.keywords.placeholder == "製品検索" && theForm.keywords.value == "") { alert('キーワードを入力してください'); theForm.keywords.focus(); return false; } else if (theForm.keywords.value == "キーワード") { alert('キーワードを入力してください'); theForm.keywords.focus(); return false; } else if (theForm.keywords.value == "keyword") { alert(keywords_tick); theForm.keywords.focus(); return false; } else if (theForm.keywords.value == '') { alert(keywords_tick); theForm.keywords.focus(); return false; } else if (theForm.keywords.value == 'ключевые слова') { alert('Введите ключевое слово'); theForm.keywords.focus(); return false; }; }; function OnFocusFun(element, elementvalue) { if (element.value == elementvalue) { element.value = ""; element.style.color = "#292929" } }; function OnBlurFun(element, elementvalue) { if (element.value == "" || element.value.replace(/\s/g, "") == "") { element.value = elementvalue; element.style.color = "#292929" } }; function OnFocusFun_m(element, elementvalue) { if (element.value == elementvalue) { element.value = ""; element.style.color = "#fff" } }; function OnBlurFun_m(element, elementvalue) { if (element.value == "" || element.value.replace(/\s/g, "") == "") { element.value = elementvalue; element.style.color = "#fff" } }; $('#keyword').keydown(function () { var keyword = $("#keyword").val(); var errora = $(this).attr('date-empty-error'); if (errora == '' || errora == null || errora == undefined) { errora = 'Please enter the keywords!'; } if (event.keyCode == 13) { if (keyword.length <= 0) { alert(errora); return false; } else { window.location.href="|:V('/tfbsdi','','')}?lfzxpset=" + keyword; } } }); $('#keyword_m').keydown(function () { var keyword = $("#keyword_m").val(); if (event.keyCode == 13) { if (keyword.length <= 0) { alert("Please enter the keywords!"); return false } else { window.location.href="|:V('/tfbsdi','','')}?lfzxpset=" + keyword; } } }); $('#keyword_mcn').keydown(function () { var keyword = $("#keyword_mcn").val(); if (event.keyCode == 13) { if (keyword.length <= 0) { alert("请输入关键字!"); return false } else { window.location.href="|:V('/tfbsdi','','')}?lfzxpset=" + keyword; } } }); $('#keyword1').keydown(function () { var keyword = $("#keyword1").val(); if (event.keyCode == 13) { if (keyword.length <= 0) { alert("Please enter the keywords!"); return false } else { window.location.href="|:V('/tfbsdi','','')}?lfzxpset=" + keyword; } } }); $('#keyword2').keydown(function () { var keyword = $("#keyword2").val(); if (event.keyCode == 13) { if (keyword.length <= 0) { alert("请输入关键字!"); return false } else { window.location.href="|:V('/tfbsdi','','')}?lfzxpset=" + keyword; } } }); $(function () { var nav = $(".side"); var win = $(window); var sc = $(document); win.scroll(function () { if (win.width() >= 992) { if (sc.scrollTop() >= 100) { nav.fadeIn(); } else { nav.fadeOut(); } } else { if (sc.scrollTop() >= 150) { $(".mobile_sidebar").css({ "transform": "scale(1)", "transitionDuration": '1s' }); if (document.referrer == '') { $(".mfb-component__button--back").css({ "transform": "scale(0)" }); } } else { $(".mobile_sidebar").css({ "transform": "scale(0)", "transitionDuration": '1s' }); } } }) }); function goTop() { var dom = $('.hjzf_nav_page li a').eq(0); if (dom.length != 0) { dom.trigger('click'); } jQuery('html,body').animate({ 'scrollTop': 0 }, 600); }; function gotoTop() { jQuery('html,body').animate({ 'scrollTop': 0 }, 600); } // slidebar 3 灵通侧边栏 jQuery(function () { jQuery('.mysidebar_btn').click(function () { jQuery('.mysidebar_wrapper').fadeIn(); }) $('.mysidebar_wrapper_colse').click(function () { $('.mysidebar_wrapper').fadeOut(); setTemCookie('mysidebar_wrapper', 111); }) getCookie('mysidebar_wrapper'); // 临时设置cookie,关闭窗口即消失; // key 键 val 值 function setTemCookie(key, val) { document.cookie = key + '=' + val; } function getCookie(name) { var cookie = document.cookie; if (cookie) { var sp = cookie.split(';'); sp.forEach(function (ele, i) { if (ele.match(name)) { $('.' + name).hide(); } }) } return; } }) // slidebar 3 end $(function () { $(".mfb-component__button--main").click(function () { if ($(this).parent().hasClass('open')) { $(this).parent().removeClass("open"); } else { $(this).parent().addClass("open"); } }); }); (function () { var muban1_arr_height = []; for (var i = 0; i < $(".main_caseitem").length; i++) { var item_height_arr = $('.main_caseitem').eq(i).find('.case_item-title').height(); muban1_arr_height.push(item_height_arr) } var max_main_proitem_name = Math.max.apply(null, muban1_arr_height); if (max_main_proitem_name > 48) { $('.case_item-title').css({ "height": '48px', 'overflow': 'hidden' }); } else { $('.case_item-title').css("height", max_main_proitem_name); } })(); $('#mianze').on('click', function () { layer.open({ type: 2, title: ['免责声明', 'font-size:18px;'], area: ['1000px', '770px'], shadeClose: true, //点击遮罩关闭 content: 'https://www.one-all.com/mianze.html' }); }); require(['jquery','proDetail'], function ($,proDetail) { proDetail.todo(); if ($(window).width() < 768) { $("#payment img, #payment1 img").parent("a").click(function () { event.preventDefault(); }); } }); require(['jquery'], function ($) { $(document).ready(function () { if ($(".main_page")) { if ($(".main_page").children().length == 0) { $(".main_page").hide(); } }; }); }); require(['jquery', 'swiper'], function ($, Swiper) { if ($('.InsidePages_navswiper').length > 0) { var leftSwiper = new Swiper('.InsidePages_navswiper', { slidesPerView: 'auto', spaceBetween: 40, navigation: { nextEl: '.InsidePages_list-next', prevEl: '.InsidePages_list-prev', }, on: { init: function (leftSwiper) { if (this.slides.length > 6) { $(".InsidePages_list-next").show(); $(".InsidePages_list-prev").show(); } } } }); }; if ($('.hjzf_innertop_navlist').length > 0) { if ($webid == '1702'){ var class_n=5; }else{ var class_n=4; } var leftSwiper = new Swiper('.hjzf_innertop_navlist', { slidesPerView: class_n, spaceBetween: 10, pagination: { el: '.hjzf_innertop_nav_pageation', clickable: true, }, breakpoints: { 640: { slidesPerView: 2, spaceBetween: 20, }, 768: { slidesPerView: 3, spaceBetween: 10, }, 992: { slidesPerView: class_n, spaceBetween: 10, }, }, on: { init: function (leftSwiper) { /* if(this.slides.length>6){ $(".InsidePages_list-next").show(); $(".InsidePages_list-prev").show(); }*/ } }, resize: function () { leftSwiper.update(true) }, }); }; }); /* require(['jqueryzoom', 'jquery'], function (jqueryzoom, $) { $("#gallery").jqueryzoom({xzoom: 320, yzoom: 240, offset: 10, position: "right"}); }); */ jQuery(function () { jQuery('.skype-show').hide(); jQuery(".skype-container").bind('mouseenter', function () { jQuery('.skype-show').show(); }) jQuery(".skype-container").bind('mouseleave', function () { jQuery('.skype-show').hide(); }); }); jQuery(function () { jQuery('.whatsapp-show').hide(); jQuery(".whatsapp-container").bind('mouseenter', function () { jQuery('.whatsapp-show').show(); }) jQuery(".whatsapp-container").bind('mouseleave', function () { jQuery('.whatsapp-show').hide(); }); }); jQuery(function () { jQuery('.email-show').hide(); jQuery(".email-container").bind('mouseenter', function () { jQuery('.email-show').show(); }) jQuery(".email-container").bind('mouseleave', function () { jQuery('.email-show').hide(); }); }); require(['jquery'], function ($) { /*第三套分类内页*/ $(document).ready(function () { $(".inner-3__anchorUl li").click(function () { $(this).addClass("active").siblings("li").removeClass("active"); }) }) }); // 手机站替换电话链接 require(['jquery'], function ($) { // 修改手机站底部 0086-xxxxx号码为0086xxxxx; $(function () { $('[href^="tel:"]').each(function () { var self = $(this); var url = self.attr('href'); var newUrl = url.replace("-", ""); self.attr('href', newUrl); }) }) // btn 到顶部消失 function hideBtn(top) { var side_first_btn = $('.side_first_btn'); if (top < 500) { side_first_btn.fadeOut(); } else { side_first_btn.fadeIn(); }; } $(window).scroll(function () { var top = $(window).scrollTop(); hideBtn(top); }); var top = $(window).scrollTop(); hideBtn(top); }); $(function () { function random(max, min) { return Math.floor(Math.random() * (max - min) + min); }; function Trims(str) { return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '') } function is_email(str) { return (/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(str)); } $('.content_submit div').each(function () { var input = $(this).find('input'); var textrae = $(this).find('textarea'); input.focus(function () { $(this).siblings('span').html(''); }); var img = $(this).find('img'); img.click(function () { $(this).attr('src', '/code_char.php?webid=1&time=12345;'); }); }); $('.bottom_submit_content').click(function () { var flag = contentsubmit(); if (!flag) { return false; } return true; }) function contentsubmit() { var stra = ''; $('.content_xp li .info').each(function () { var che = $(this).find('input').get(0).checked; var info = $(this).find('.info_content'); if (che) { stra += '&' + info.find('strong').text() + '&' + info.find('p').eq(0).text() + '&' + info.find('p').eq(1).text() + '&'; } }) var count = 0; var message = Trims($("#message_con").val()); var linkname = Trims($("#linkname_con").val()); var comname = Trims($("#companyname").val()); var phone = Trims($("#phone_con").val()); var email = Trims($("#email_con").val()); var companyname = Trims($("#companyname").val()); var mesVal = $("#message_con").val(); if (linkname.length <= 0) { $("#linkname_error").html("姓名不能为空!"); count++; } else { $("#linkname_error").html(""); }; if (companyname.length <= 0) { $("#companyname_error").html("公司名称不能为空!"); count++; } else { $("#companyname_error").html(""); }; var str = /[\u4E00-\u9FA5a-zA-Z]/; console.log(str.test(phone)); if (phone.length <= 0) { $("#phone_error").html("*电话不能为空!"); count++; } else if (str.test(phone)) { $("#phone_error").html("*电话号码有误!"); count++; } else { $("#phone_error").html(""); } if (email.length == 0) { count++; $("#email_error").html("*邮箱格式错误"); } else if (email.length > 0 && !is_email(email)) { $("#email_error").html("*邮箱格式错误"); count++; } else { $("#email_error").html(""); } if (mesVal.length <= 0) { $("#message_error").html("咨询内容不能为空!"); count++; } else { $('message_error').html(""); } if (count > 0) { return false; } $('#message_con').val(mesVal + stra); return true; } /* 底部二维码点击效果 */ $('.mobile_down li.qrcode,.mobile_down li.wx_qrcode').on('click', function () { $(this).find('img').toggle(); }) /* 去除swiper只为一个时候的圆点 */ window.onload = function () { var swiper_button = $('.swiper-pagination-bullets'); if (swiper_button.length > 0) { swiper_button.each(function () { var self = $(this); var len = self.find('span').length; if (len < 2) { self.hide(); } }) } }; $('.mobile_navbutton').click(function () { $('.d-none').addClass('on'); $('.mobile_video').addClass('on'); }); $('.mobile-menu-Sidebar-close').click(function () { $('.d-none').removeClass('on'); $('.mobile_video').removeClass('on'); }); }); /* 微信提示QQ号码代码 */ function isWeixin() { var ua = window.navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == 'micromessenger') { /* 是微信 */ return true; } else { return false; } } function addQq(event, qq) { var e = event || window.event; var flag = isWeixin(); if (flag) { e.preventDefault(); e.stopPropagation(); alert('联系QQ:' + qq); } } function weStop(event) { var e = event || window.event; var flag = isWeixin(); if(flag){ e.preventDefault(); } } //验证邮箱 function is_email(str) { return (/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(str)); }; //验证空格 function Trims(str) { if(!str) return ''; return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }; //验证电话 function is_phone(str) { var prstr=/[\u4E00-\u9FA5a-zA-Z]/; return (prstr.test(str)); }; /*表格超出滚动条显示*/ if($(".pro_detail").length>0 && !overScrollTableDetail){ $.each($(".pro_detail table"),function(){ //console.log("actual",$(this).actual('width')); if($(window).width()<768){ $(this).wrap("
").wrap("
"); } }) }; if($(".InsidePages_content-right2").length>0 && $webid != 2207 && !overScrollTableDetail){ $.each($(".InsidePages_content-right2 table"),function(){ //console.log("actual",$(this).actual('width')); if($(window).width()<768){ $(this).wrap("
").wrap("
"); } }) }; if($(".HJZF_Z__inner--right").length>0 && !overScrollTableDetail){ $.each($(".HJZF_Z__inner--right table"),function(){ //console.log("actual",$(this).actual('width')); if($(window).width()<768){ $(this).wrap("
").wrap("
"); } }) }; // 详情页视频点击弹出窗口 require(['layer', 'jquery'], function (layer, $) { $(function () { $('.detail_layer').click(function () { var dataUrl = $(this).attr('href'); if(dataUrl) { layer.open({ type: 2, title: false, shadeClose: true, area: ['80%','80%'], content: dataUrl }); }; return false; }) }) }); //swiper require(['jquery', 'swiper'], function ($,Swiper) { $(".c_swiper-container").each(function(index, element) { var config=$(this).attr("data-slider-settings"); if(config){ var mySwiper = new Swiper (this, JSON.parse(config)); } }); }); // 视频标记展示 require(['jquery'], function ($) { $(document).ready(function(e) { $(".detail_video_index_zq_img,.detail_video_zq_img").find("img").wrap("
"); $(".detail_video_index_zq_img img,.detail_video_zq_img img").each(function(index, element) { var position=$(this).css("position"); if(position=="absolute"){ $(this).parents(".video_container").css("position","static"); } }); }); });