$(".hb").click(function () { $(".hbs").show(); var thisa = $(this); var title = thisa.data("title"); var time = thisa.data("time"); var des = thisa.data("des"); var url = thisa.data("url"); $(".mobile-share-title").html('
' + title); $(".mobile-share-time").text(time); $(".mobile-share-text p").text(des); console.log(url); ewm(url); var node = document.querySelector('.mobile-share-inner') var width = $('.mobile-share-inner')[0].offsetWidth; //dom瀹 var height = $('.mobile-share-inner')[0].offsetHeight; //dom楂 // 瑙e喅鍥剧墖妯$硦 var scale = 2;//鏀惧ぇ鍊嶆暟 var canvas = document.createElement('canvas'); canvas.width = width * 2; canvas.height = height * 2; canvas.style.width = width + 'px'; canvas.style.height = height + 'px'; var context = canvas.getContext('2d'); context.scale(scale, scale); //璁剧疆context浣嶇疆锛屽€间负鐩稿浜庤绐楃殑鍋忕Щ閲忚礋鍊硷紝璁╁浘鐗囧浣?瑙e喅鍋忕Щ鐨勯噸鐐? var rect = $('.mobile-share-inner').get(0).getBoundingClientRect();//鑾峰彇鍏冪礌鐩稿浜庤瀵熺殑鍋忕Щ閲 context.translate(-rect.left, -rect.top); context.fillStyle = "red"; var opts = { canvas: canvas, backgroundColor: null, useCORS: true, // 銆愰噸瑕併€戝紑鍚法鍩熼厤缃 scrollY: 0, // 绾靛悜鍋忕Щ閲 鍐欐0 鍙互閬垮厤婊氬姩閫犳垚鍋跺皵鍋忕Щ鐨勭幇璞 }; html2canvas($(".mobile-share-inner")[0], opts).then(canvas => { // 浣跨敤toDataURL鏂规硶灏嗗浘鍍忚浆鎹㈣base64缂栫爜鐨刄RL瀛楃涓 var src = canvas.toDataURL(); $(".mobile-share-canvas img").attr("src", src); }); }) function ewm(url) { $("#2wm").html(""); var qrcode = new QRCode("2wm", { text: url, width: 70, height: 70, colorDark: "#000", colorLight: "#FFF", correctLevel: QRCode.CorrectLevel.H }); } $(".mobile-share-close").click(function () { $(".hbs").hide(); }) $(function () { $(window).scroll(function () { var h = $(window).height(); var sc = $(window).scrollTop(); if (sc > 0) { $(".header").addClass('scroll'); } else { $(".header").removeClass('scroll'); } }) }) // PC绔 $(document).ready(function () { $(".navbar-togger.menu").on("click", function () { var navHear = $(".header"); var open = navHear.hasClass("open-PCmenu"); if (open) { $('.nav-PCmenu').stop().slideUp(200); console.log(111) navHear.removeClass("open-PCmenu"); } else { $('.nav-PCmenu').stop().slideToggle(200); navHear.addClass("open-PCmenu"); } }); }); //===============app-header锛宻tart=============== $(function () { // 鎵嬮鐞翠笅鎷 var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.P_tig'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.P_parent').find(".P_slide"); $next.slideToggle(); $this.parents('.P_parent').toggleClass('open'); if (!e.data.multiple) { $el.find('.P_slide').not($next).slideUp().parent().removeClass('open'); }; } var accordion_header = new Accordion($('.nav-list'), false); //footer var accordion_footer = new Accordion($('.footer-menu'), false); // 鎵嬫満绔 var navHear = $(".header-app"); $(".header-app .navbar-togger").on("click", function () { var open = navHear.hasClass("open-menu"); if (open) { navHear.removeClass("open-menu"); $(".navbar-togger").removeClass('on') $('.nav-menu').hide(); } else { navHear.addClass("open-menu"); $('.nav-menu').show(); } }); }) //===============app-header锛宔nd=============== // 浜岀骇瀵艰埅 $(function () { $(".nav-top").click(function () { $(this).next('.nav-bot').slideToggle(); $(this).parents('.nav-item').siblings('.nav-item').find('.nav-bot').slideUp(); var nav_more = $(this).find('.nav-more'); if (nav_more.hasClass('open')) { $(this).find('.nav-more').removeClass('open') $(this).next('.nav-bot').slideUp(); } else { $(this).find('.nav-more').addClass('open'); $(this).next('.nav-bot').slideDown(); $(this).parents('.nav-item').siblings('.nav-item').find('.nav-bot').slideUp(); } }); }) // ==============鏍峰紡js,start=============== $(function () { // css鍔ㄧ敾 var isIE = function (ver) { ver = ver || ''; var b = document.createElement('b'); b.innerHTML = ''; return b.innerHTML === '1' }; if (isIE(8) || isIE(7)) { } else { // 鍔ㄧ敾 wow = new WOW({ animateClass: 'animated', mobile: false, }); wow.init(); } // 鍔ㄧ敾 let landInTexts = document.querySelectorAll(".landIn"); landInTexts.forEach(landInText => { let letters = landInText.textContent.split(""); landInText.textContent = ""; letters.forEach((letter, i) => { let span = document.createElement("span"); //鍒涘缓span鏍囩 span.setAttribute('class', 'kongs'); //缁欐爣绛炬坊鍔犵被鍚 span.textContent = letter; span.style.animationDelay = `${i * 0.12}s`; landInText.append(span); }); }) }) $(function () { //kefu $(".kf span").hover(function () { $(this).find("div").show(); }, function () { $(this).find("div").hide(); }); $(".kf span div").hover(function () { $(this).show(); }, function () { $(this).hide(); }); $(".kf .back_top").click(function () { $("html,body").animate({ "scrollTop": 0 }, 1000); }); $(".mod_right").click(function () { $("html,body").animate({ "scrollTop": 0 }, 1000); }); // $(".freetel").hover(function () { // var idw = this.id; // if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE7.0") { // $(this).stop(true, false).animate({ width: idw, "left": "-65px" }, 300); // } else { // $(this).stop(true, false).animate({ "width": "220px" }, 300); // } // }, function () { // if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE7.0") { // $(this).stop(true, false).animate({ "width": "78px", "left": "0" }, 300); // } else { // $(this).stop(true, false).animate({ "width": "78px" }, 300); // } // }) var i = 0; $(".shou").click("fast", function () { i++; if (i % 2 == 0) { $(this).removeClass('on'); // $(".kf").css({ "right": "30px" }); $(".kf span").css({ "right": "0px" }); } else { $(this).addClass('on'); $(".kf span").css({ "right": "-100px" }); } $(".zhan").click(function () { $(this).delay(10000).stop().fadeOut(); $(".kf").css({ "right": "30px" }); $(".shou").css({ "right": "92px" }); }); }); $(window).scroll(function () { var h = $(window).height() / 4; var sc = $(window).scrollTop(); if (sc > h) { // $(".kf").fadeIn(); } else { // $(".kf").fadeOut(); } }); // kf $(".kf-shqi").on("click", function () { $('.kf').toggleClass("show"); if ($('.kf').hasClass("show")) { $('.kf').find("span").fadeIn() } else { $('.kf').find("span").fadeOut() } }); }) // $(document).ready(function () { // var p = 0, t = 0; // $(window).scroll(function (e) { // p = $(this).scrollTop(); // if (p > 0) { } // else { } // if (t <= p) { // $('.header').addClass('pageScroll'); // } // else if (p === 0) { // } else { // $('.header').removeClass('pageScroll'); // } // t = p; // }) // }) // }) $(function () { $('.vedio').click(function () { var SRC SRC = $(this).attr('src'); if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { window.location.href = SRC; } else { // 鍋滄褰撳墠鐨勫姩鐢伙紝骞剁Щ闄ゅ叾浣欑殑鍔ㄧ敾闃熷垪 $('#msg-box-bg').stop(true, false).fadeIn() $('#msg-box-bg .msg-box').stop(true, false).animate({ // 浠庝笂婊戝嚭鐨勬晥鏋 'top': '50%', }, 800) $("#vedios").attr('src', SRC) } }); $('#close-box').click(function () { $('#msg-box-bg').stop(true, false).fadeOut() $('#msg-box-bg .msg-box').stop(true, false).animate({ 'top': '-50%', }, 300) $("#vedios").attr('src', '') // $('body').css({ 'overflow': 'auto' }); }); $('#vedio').click(function () { var SRC SRC = $(this).attr('src'); console.log(SRC) SRC = $(this).attr('src'); if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { window.location.href = SRC; } else { // 鍋滄褰撳墠鐨勫姩鐢伙紝骞剁Щ闄ゅ叾浣欑殑鍔ㄧ敾闃熷垪 $('#msg-box-bg').stop(true, false).fadeIn() $('#msg-box-bg .msg-box').stop(true, false).animate({ // 浠庝笂婊戝嚭鐨勬晥鏋 'top': '50%', }, 800) $("#vedios").attr('src', SRC) } }); $('#close-box').click(function () { $('#msg-box-bg').stop(true, false).fadeOut() $('#msg-box-bg .msg-box').stop(true, false).animate({ 'top': '-50%', }, 300) $("#vedios").attr('src', '') // $('body').css({ 'overflow': 'auto' }); }); }) // ============== 鏍峰紡js, end =============== $(function () { var scale = 1920 / 320, imgScale = 639 / 425, circleW = 0, circleH = 0, scaleW = 0, scaleH = 0, borderW = 0; $(window).bind('resize', function () { console.log(222) var itemWidth = Math.ceil($('.bigCircle').width() / 3), itemHeight = Math.ceil(itemWidth / imgScale); circleW = itemWidth * 3; circleH = itemWidth * 3; scaleW = Math.ceil($('.bigCircle').width() / scale); scaleH = Math.ceil($('.bigCircle').width() / scale); borderW = (circleW - scaleW) / 2; $('.bigCircle .circle').each(function () { $(this).css({ 'width': circleW + 'px', 'height': circleH + 'px' }); }); }).trigger('resize'); $('.bigCircle .com-swxt').bind('mouseenter', function () { $(this).find('.circle').css({ 'border-width': borderW + 'px' }); }).bind('mouseleave', function () { $(this).find('.circle').css({ 'border-width': 0 }); }); } ) $( function () { //pc浜у搧涓夌骇瀵艰埅 var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.pro-item1'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.pro-parent1').find(".pro-slide1"); $next.slideToggle(); $this.parents('.pro-parent1').toggleClass('open'); if (!e.data.multiple) { $el.find('.pro-slide1').not($next).slideUp().parent().removeClass('open'); }; } var accordion_pro = new Accordion($('.pro-menu'), false); var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.pro-tig2'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.pro-parent2').find(".pro-slide2"); $next.slideToggle(); $this.parents('.pro-parent2').toggleClass('open'); if (!e.data.multiple) { $el.find('.pro-slide2').not($next).slideUp().parent().removeClass('open'); }; } var accordion_pro = new Accordion($('.pro-slide1'), false); //apppc浜у搧涓夌骇瀵艰埅 var Accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.app-tig'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } Accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.app-parent').find(".pro-menu"); $next.slideToggle(); $this.parents('.app-parent').toggleClass('open'); if (!e.data.multiple) { $el.find('.pro-menu').not($next).slideUp().parent().removeClass('open'); }; } var accordion_pro = new Accordion($('.app-menu'), false); } ) // 涓嬫媺鎬濊矾锛 $('.header-container .navbar-li').hover(function () { var dropH = $(this).find('.dropmenu').height(); if (dropH != 0 || dropH != " " || dropH != null) { $('.navbar-bj').css("height", dropH).stop(true, false).fadeIn(); } if (dropH != 0 && dropH != " " && dropH != null) { // $('.navbar-bj').css("border-bottom", '1px solid #cc0200') } else { // $('.navbar-bj').css("border-bottom", 'none') } }) // 涓夌骇涓嬫媺鎬濊矾锛 $('.header-container .drop-li').hover(function () { var dropH = $(this).parents('.dropmenu').height(); var dropTwoH = $(this).find('.dropmenu-two').innerHeight(); //console.log(dropTwoH) // 濡傛灉涓夌骇瀵艰埅瀛樺湪锛屽垯姣旇緝浜岀骇鍜屼笁绾х殑楂樺害 if (dropTwoH != 0 || dropTwoH != " " || dropTwoH != null) { if (dropTwoH > dropH) { $('.navbar-bj').css("height", dropTwoH).stop(true, false).fadeIn(); } else { $('.navbar-bj').css("height", dropH).stop(true, false).fadeIn(); } } else { $('.navbar-bj').css("height", dropH).stop(true, false).fadeIn(); } }) $(".dropmenu-two .drop-li2").hover(function () { var img = $(this).attr("data-imgsrc"); console.log(img) $(this).parents(".dropmenu-two").find("img").attr("src", img); }) $('.nav-search').hover(function () { var dropH = $(this).find('.search-box').height(); if (dropH != 0 || dropH != " " || dropH != null) { $('.navbar-bj').css("height", dropH).stop(true, false).fadeIn(); } }) $(function(){ $("img").each(function () { var p = $(this).parent("p"); if (typeof(p.attr("style"))!="undefined") { var styles = p.attr("style") console.log(styles); if(styles.indexOf("text-indent: 2em;")>-1) { styles = styles.replace("text-indent: 2em;"); p.attr("style",styles); } } }) })