//强制https-- // var targetProtocol = "https:"; // if (window.location.protocol != targetProtocol) // window.location.href = targetProtocol + // window.location.href.substring(window.location.protocol.length); $(document).ready(function () { /*-------------------导航下拉滚动条效果--------------------*/ //标示动画是否执行 var isAnimated = false; //on() 添加监听 "所要监听的事件" function(){}当监听到事件后执行的方法 $(window).on("scroll", function () { //this代表window scrollTop()向上滑动的距离 if ($(this).scrollTop() > 0) { $(".nav").addClass("nav-fixed"); //如果动画执行过 if (!isAnimated) { $(".nav").css("top", "-56px"); //每次要执行动画之前都将top值设为-40px $(".nav").animate({ top: "0px" }, 1000); isAnimated = true; } } else { isAnimated = false; $(".nav").removeClass("nav-fixed"); } }); $(".try_inputDis .try_sub").bind("click", function () { $(".try_blur").blur(); var errorLen = $(".try_cont a.try_inputIcon_error").length; if (errorLen == 0) { // 在这里提交数据到后台 registToSale(); } }); //初始化输入框 $("input.try_contInput") .focus(function () { $(this).addClass("try_contInput_hover"); $(this).css("color", "#333"); // var fVal = $(this).attr("val"); var tVal = $.trim($(this).val()); if (tVal == fVal) { $(this).val(""); } }) .blur(function () { $(this).removeClass("try_contInput_hover"); var fVal = $(this).attr("val"); var tVal = $.trim($(this).val()); if (tVal == "") { $(this).css("color", "#B4B7BB"); // $(this).val(fVal); } }); /*视频播放*/ $(".try_box_buy .btn-close").click(function () { $(".overlay,.try_box_buy").hide(); }); /*------根据来源修改销售热线------------*/ function hotlineUpdate(hotline) { var exp = new Date(); exp.setTime(exp.getTime() + 10080 * 60 * 1000); //过期时间 7天 document.cookie = "hotline=" + escape(hotline) + ";expires=" + exp.toGMTString() + ";path=/;domain=.263.net"; } function getCookie(cookieName) { var allcookies = document.cookie; var cookiePos = allcookies.indexOf(cookieName); //索引的长度 if (cookiePos != -1) { // 把cookie_pos放在值的开始,只要给值加1即可。 cookiePos += cookieName.length + 1; var cookieEnd = allcookies.indexOf(";", cookiePos); if (cookieEnd == -1) { cookieEnd = allcookies.length; } var value = decodeURI(allcookies.substring(cookiePos, cookieEnd)); } return value; } //首页产品 $(".index-products ul li").on("mouseenter", function () { $(".index-products ul li").removeClass("on"); $(this).addClass("on"); $(".index-products-box .section").hide().eq($(this).index()).show(); }); //首页客户证言 $(".logo-left li,.logo-right li").on("mouseenter", function () { $(".logo-left li,.logo-right li").removeClass("on"); $(this).addClass("on"); var i = $(this).index(); if ($(this).parent().hasClass("logo-right")) { i = i + 3; } $(".index-customsay") .find(".con") .children("li") .fadeOut(0) .eq(i) .fadeIn(500); }); //表格收缩 /*$(".btn-more").click(function(){ if($("table").find("tr:last").is(':hidden')){ $("tr").show() $(".btn-more").html("--- 收起 ---") }else{ $("tr").slice(7).hide() $(".btn-more").html("--- 显示全部 ---") } })*/ //售前咨询非工作时间 $(".consult-offline-confirm .confirm-box .list .btn-close").live( "click", function () { $(".consult-offline-confirm").fadeOut(200); } ); $(".consult-offline-box").live("click", function () { $(".consult-offline-confirm").fadeIn(200); }); }); // 返回顶部 (function ($) { var goToTopTime; $.fn.goToTop = function (options) { var opts = $.extend({}, $.fn.goToTop.def, options); var $window = $(window); $body = window.opera ? document.compatMode == "CSS1Compat" ? $("html") : $("body") : $("html,body"); // opera fix //$(this).hide(); var $this = $(this); clearTimeout(goToTopTime); goToTopTime = setTimeout(function () { var cssfixedsupport = $.browser.msie && parseFloat($.browser.version) < 7; //判断是否ie6 var controlTop = $window.height() - $this.height() - opts.pageHeightJg; controlTop = cssfixedsupport ? $window.scrollTop() + controlTop : controlTop; var shouldvisible = $window.scrollTop() >= opts.startline ? true : false; if (shouldvisible) { //$this.stop().show(); $this.fadeIn(300); } else { //$this.stop().hide(); $this.fadeOut(300); } $this.css({ position: cssfixedsupport ? "absolute" : "fixed" }); }, 30); $(this).click(function (event) { $body .stop() .animate({ scrollTop: $(opts.targetObg).offset().top }, opts.duration); $(this).blur(); event.preventDefault(); event.stopPropagation(); }); }; $.fn.goToTop.def = { pageWidth: 910, //页面宽度 pageWidthJg: 2, //按钮和页面的间隔距离 pageHeightJg: 100, //按钮和页面底部的间隔距离 startline: 600, //出现回到顶部按钮的滚动条scrollTop距离 duration: 500, //回到顶部的速度时间 targetObg: "body", //目标位置 }; })(jQuery); $(function () { $( '回到顶部' ).appendTo("body"); }); //导航 (function ($) { $.fn.menumaker = function (options) { var cssmenu = $(this), settings = $.extend( { title: "导航", format: "dropdown", sticky: false, }, options ); return this.each(function () { cssmenu.prepend('"); $(this) .find("#menu-button") .on("click", function () { $(this).toggleClass("menu-opened"); var mainmenu = $(this).next("ul"); if (mainmenu.hasClass("open")) { mainmenu.hide().removeClass("open"); } else { mainmenu.show().addClass("open"); if (settings.format === "dropdown") { mainmenu.find("ul").show(); } } }); cssmenu.find("li ul").parent().addClass("has-sub"); multiTg = function () { cssmenu .find(".has-sub") .prepend(''); cssmenu.find(".submenu-button").on("click", function () { $(this).toggleClass("submenu-opened"); if ($(this).siblings("ul").hasClass("open")) { $(this).siblings("ul").removeClass("open").hide(); } else { $(this).siblings("ul").addClass("open").show(); } }); }; if (settings.format === "multitoggle") multiTg(); else cssmenu.addClass("dropdown"); if (settings.sticky === true) cssmenu.css("position", "fixed"); resizeFix = function () { if ($(window).width() > 768) { cssmenu.find("ul").show(); } if ($(window).width() <= 768) { cssmenu.find("ul").hide().removeClass("open"); } }; resizeFix(); return $(window).on("resize", resizeFix); }); }; })(jQuery); (function ($) { $(document).ready(function () { $("#cssmenu").menumaker({ title: "股票代码:003025", format: "multitoggle", }); //$("#cssmenu").prepend(""); var foundActive = false, activeElement, linePosition = 0, menuLine = $("#cssmenu #menu-line"), lineWidth, defaultPosition, defaultWidth; $("#cssmenu > ul > li").each(function () { if ($(this).hasClass("active")) { activeElement = $(this); foundActive = true; } }); if (foundActive === false) { activeElement = $("#cssmenu > ul > li").first(); } defaultWidth = lineWidth = activeElement.width(); defaultPosition = linePosition = activeElement.position().left; menuLine.css("width", lineWidth); menuLine.css("left", linePosition); $("#cssmenu > ul > li").hover( function () { activeElement = $(this); lineWidth = activeElement.width(); linePosition = activeElement.position().left; menuLine.css("width", lineWidth); menuLine.css("left", linePosition); event.stopPropagation(); }, function () { menuLine.css("left", defaultPosition); menuLine.css("width", defaultWidth); } ); /*右侧客服*/ $(".right-service .btn").on("mouseover", function () { $(".right-service .service-detail .service-box").fadeIn(200); }); $(".right-service .service-detail .service-box").on( "mouseleave", function () { $(this).fadeOut(200); } ); $(".right-service .service-detail .service-box .box-close").on( "click", function () { $(".right-service .service-detail .service-box").fadeOut(200); } ); /*登录窗体*/ $(".login-icon").on("mouseenter", function () { $(this).children(".iframe-login").fadeIn(200); }); $(".login-icon .iframe-login").on("mouseleave", function (e) { var o = e.relatedTarget || e.toElement; //解决chrome内核点击触发该事件 if (!o) return; $(this).fadeOut(200); }); /*视频播放*/ $(".video-box .btn-close").click(function () { $(".video-box .videoCon").html(""); $(".overlay,.video-box").hide(); }); // JavaScript Document /*解决方案二级导航*/ $(function () { var divTopArr = []; for (var i = 0; i < $(".floor").length; i++) { divTopArr.push($(".floor").eq(i).offset().top); } $(".solution-nav-li li").on("click", function () { $("body,html").animate( { scrollTop: divTopArr[$(this).index()] + "px" }, 1000 ); }); //添加页面滚轮滚动事件, $(window).scroll(function () { var scrollTop = $(window).scrollTop(); for (i = 0; i < $(".floor").length; i++) { if (scrollTop < divTopArr[divTopArr.length - 1]) { if (scrollTop >= divTopArr[i] && scrollTop < divTopArr[i + 1]) { $(".solution-nav-li li a").removeClass("cur"); $(".solution-nav-li li").eq(i).children("a").addClass("cur"); } } else { $(".solution-nav-li li a").removeClass("cur"); $(".solution-nav-li li") .eq(divTopArr.length - 1) .children("a") .addClass("cur"); } } }); }); }); })(jQuery); function videoplay(title, url, width, height) { $(".overlay,.video-box").show(); $(".video-box h4").html(title); $(".video-box .videoCon").html( "" ); } //返回顶部 $(function () { $(".backToTop").goToTop(); $(window).bind("scroll resize", function () { $(".backToTop").goToTop(); }); });