// JavaScript Document // JavaScript Document /**/ /*document.onkeydown = function(){ if(window.event && window.event.keyCode == 123) { event.keyCode=0; event.returnValue=false; } if(window.event && window.event.keyCode == 13) { window.event.keyCode = 505; } if(window.event && window.event.keyCode == 8) { window.event.returnValue=false; } } document.oncontextmenu = function (event){ if(window.event){ event = window.event; }try{ var the = event.srcElement; if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){ return false; } return true; }catch (e){ return false; } } //屏蔽键盘事件 document.onkeydown = function (){ var e = window.event || arguments[0]; //F12 if(e.keyCode == 123){ return false; //Ctrl+Shift+I }else if((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)){ return false; //Shift+F10 }else if((e.shiftKey) && (e.keyCode == 121)){ return false; //Ctrl+U }else if((e.ctrlKey) && (e.keyCode == 85)){ setTimeout(function(){   },1); return false; } }; //屏蔽鼠标右键 document.oncontextmenu = function (){ setTimeout(function(){   },1); return false; }*/ $(function(){ $("header").addClass("on"); $("header #nav li").hover(function(){ $(this).find(".navxiala").fadeToggle(); }); $(".banner").addClass("on"); $(".banner .line_box").addClass("on"); $(".banner .miso-list li").addClass("on"); /*$('.banner .slider').on('afterChange', function (event, miso, currentSlide) { $(".banner .miso-list li.miso-current").prev("li").addClass("on"); });*/ $("header #nav li:nth-child(3)").css("margin-right","220px"); $(window).scroll(function () { var windowTop = $(window).scrollTop(); if (windowTop > 400) { $(".content").addClass("binboxAct"); $(".banner .miso-dots").addClass("on"); } else { $(".content").removeClass("binboxAct"); $(".banner .miso-dots").removeClass("on"); } }); var a = $('.target'); $(window).on('scroll', function() { a.removeClass('action'); for(var i = 0; i < a.length; i++) { var $a = a.eq(i), st = $(window).scrollTop(); var top = $a.offset().top; if (st >= top - 142 && st <= $a.height() + top) // top >= st >= top + height { $a.addClass('action'); //此处已经获得了哪个a break; } } }); $('.btn[name]').click(function() { var tf_name_id = $(this).attr('name'); $('.tc[name=' + tf_name_id + ']').addClass('act'); }); $('.close').click(function() { $(this).parents('.tc').removeClass('act'); }); $('.tc-bg').click(function() { $(this).parents('.tc').removeClass('act'); }); /*************************************** * name: weixinScanAnimation * tips: 微信扫描动画 ****************************************/ if($('#weixinScanAnimation').length>0){ var scanSpeed=2000; var scanpHeight=140; setWeixinH(scanpHeight,scanSpeed); var weixinInterval=setInterval(function(){ if($('#weixinScanAnimation .scanMask').height()<=5){ setWeixinH(scanpHeight,scanSpeed); }else{ setWeixinH(0,scanSpeed); } },scanSpeed); function setWeixinH(height,time){ $('#weixinScanAnimation .scanMask').animate({'height':height},time); } } $('footer .fl02 ul.ul01 li').mouseenter(function(){ var eleParent = $(this).parent(); eleParent.find('.tc-box01').stop().slideDown(500); }); $('footer .fl02 ul.ul01 li').mouseleave(function(){ var that = $(this); that.find('.tc-box01').stop().slideUp(500); }); //IE9 兼容placdholder属性 function placeholderSupport() { return 'placeholder' in document.createElement('input'); } if(!placeholderSupport()){ // 判断浏览器是否支持 placeholder $("[placeholder]").each(function(){ var _this = $(this); // console.log($(this).height()); var inputHeight = parseInt(parseInt($(this).height()-2)-14)/2; var inputHeight = parseInt(parseInt(parseInt($(this).height()-2)/2)-7)+'px'; _this.parent().css({"position": "relative"}); var left = _this.position().left+parseInt(_this.css("padding-left"))+parseInt(_this.css("margin-left"))+"px"; var top = parseInt(_this.css("padding-top"));//+parseInt(_this.css("margin-top"))+"px"; var top = parseInt(_this.css("padding-top"));//+parseInt(_this.css("margin-top"))+"px"; _this.after('' + _this.attr("placeholder") + ''); //_this.after('' + _this.attr("placeholder") + ''); if(_this.val() != ""){ _this.parent().find("span.placeholder").hide(); } else{ _this.parent().find("span.placeholder").show(); } }).on("focus", function(){ $(this).parent().find("span.placeholder").hide(); }).on("blur", function(){ var _this = $(this); if(_this.val() != ""){ _this.parent().find("span.placeholder").hide(); } else{ _this.parent().find("span.placeholder").show(); } }); // 点击表示placeholder的标签相当于触发input $("span.placeholder").on("click", function(){ $(this).hide(); $(this).siblings("[placeholder]").trigger("click"); $(this).siblings("[placeholder]").trigger("focus"); }); } /*var e = document.querySelector("#ac-cursor"), t = function () { TweenMax.to(e, .5, { autoAlpha: 1 }) }, n = function (e) { s.mouseX = e.clientX, s.mouseY = e.clientY }, r = function () { var e = document.querySelector("#ac-drag"), t = c()(".swiper-container, ac-slider-nav, #ac-menu, #ac-contact-page"); t.length && t.each(function () { var t = c()(this)[0]; t.addEventListener("mousemove", function () { e.classList.contains("ac-show") || (e.classList.add("ac-show"), TweenMax.to(e, .5, { autoAlpha: 1 })) }), t.addEventListener("mouseleave", function () { e.classList.remove("ac-show"), TweenMax.to(e, .5, { autoAlpha: 0 }) }) }) }, o = function t() { e.x = h(e.x, s.mouseX, .1), e.y = h(e.y, s.mouseY, .1), e.style.transform = "translateX(".concat(e.x, "px) translateY(").concat(e.y, "px)"), e.handle = requestAnimationFrame(t) }; return { init: function () { var i; document.addEventListener("mousemove", t, { once: !0 }), document.addEventListener("mousemove", n), e.x = s.mouseX, e.y = s.mouseY, e.handle = requestAnimationFrame(o), i = document.querySelector("#ac-cursor-progress circle"), s.scrollbar && s.scrollbar.addListener(function () { var e = s.y / (s.scrollbar.size.content.height - window.innerHeight); TweenMax.to(i, .5, { strokeDashoffset: 200 * (1 - e), overwrite: 5 }) }), function () { var e, t = document.querySelectorAll("a, .ac-slider-nav, .swiper-container, #ac-menu-opener, #ac-menu, .ac-loader-item, .ac-footer-cta-inner, .ac-vertical-links, .ac-about-trigger"), n = document.querySelector("#ac-scroll-indicator"), r = function () { TweenMax.to(n, .5, { autoAlpha: 1 }) }, o = function () { TweenMax.to(n, .5, { autoAlpha: 0 }) }; t.forEach(function (e) { ["mouseover", "mousemove"].forEach(function (t) { return e.addEventListener(t, function () { n.classList.contains("ac-hide-trig") || (n.classList.add("ac-hide-trig"), o()) }) }), e.addEventListener("mouseleave", function () { n.classList.remove("ac-hide-trig"), r() }) }); var i = function () { clearTimeout(e), !n.classList.contains("ac-hide-trig") && r(), e = setTimeout(function () { o() }, 2e3) }; document.addEventListener("mousemove", i), document.addEventListener("wheel", i) }(), r() }, detach: function () { document.removeEventListener("mousemove", t), document.removeEventListener("mousemove", n), cancelAnimationFrame(e.handle) }, hide: function () { var e = document.querySelectorAll("#ac-drag-progress circle"), t = document.querySelectorAll("#ac-cursor-progress circle"); TweenMax.to(e, .5, { strokeDashoffset: 0, overwrite: 1 }), TweenMax.to(t, .5, { strokeDashoffset: 200, overwrite: 1 }) }, showIndicator: function () { var e = document.querySelector("#ac-scroll-indicator"); e.classList.remove("ac-hide-trig"), TweenMax.to(e, .5, { autoAlpha: 1 }) }, draggerProgress: function (e) { var t = document.querySelector("#ac-drag-progress circle"); TweenMax.to(t, 1, { strokeDashoffset: 200 * (1 - e), overwrite: 5 }) }, fadeInCursor: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; TweenMax.to(e, .4, { autoAlpha: 1, delay: t, overwrite: 5 }) }, fadeOutCursor: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0; TweenMax.to(e, .2, { autoAlpha: 0, delay: t, overwrite: 5 }) } }*/ /*$('.container00 .miso_hd').miso({ autoplaySpeed: 6000, autoplay: false, speed: 300, slidesToShow: 3, slidesToScroll: 1, arrows: false, dots:false, touchThreshold: 10, pauseOnHover: false, focusOnSelect: true, asNavFor: '.container00 .miso_bd' }); $('.container00 .miso_bd').miso({ autoplaySpeed: 6000, autoplay: false, speed: 300, slidesToShow: 1, slidesToScroll: 1, arrows: false, dots:false, touchThreshold: 10, pauseOnHover: false, focusOnSelect: true, asNavFor: '.container00 .miso_hd' }); var smVideo = { load: function (objs) { var objplay = jwplayer(objs.vcontainer).setup({ html5player: '/static/style/pc/js/video/html5player.js', file: objs.vfiles, image: objs.vfimg, width: '100%', height: '100%', aspectratio: '16:9', stretching: 'fill', controls: 'true', autostart: objs.isautoplay }); return objplay; } } $('').click(function () { smVideo.load({ vcontainer: 'videobox', //视频容器 vfiles: jQuery(this).attr("data-video"), //视频地址 vfimg: jQuery(this).attr("data-img"), //视频缩略图(封面) isautoplay: 'true' }); $(".vwrap").fadeIn(); }); $(".vwrap .close").click(function () { $(".vwrap").hide(); $('#videobox').html(""); });*/ });