$(function () { var image = new Image(); image.onload = function () { var imgWidth = $('.ty-banner-1 img').width(); var windowWidth = $(window).width(); var length = (imgWidth - windowWidth) / 2; if (length > 0) { $('.ty-banner-1 img').attr('style', 'margin-left:' + (-length) + 'px'); } $('.ty-banner-1 img').addClass('show'); } image.src = $('.ty-banner-1 img').attr('src'); }); $(function () { var si = setInterval(function () { var imgIsShow = $('.k12-cx-cpgs-ts2-1-01-left-pic img').last().height(); if (imgIsShow > 0) { $(".k12-cx-cpgs-ts2-1-01-left").slide({ mainCell: ".k12-cx-cpgs-ts2-1-01-left-pic ul", vis: 1, scroll: 1, effect: "left", autoPlay: true, autoPage: true, titOnClassName: "cur", prevCell: ".k12-cx-cpgs-ts2-1-01-left-prev", nextCell: ".k12-cx-cpgs-ts2-1-01-left-next", pageStateCell: ".k12-cx-cpgs-ts2-1-01-left-size" }); clearInterval(si); } }, 10) }) $(function () { var contentDiv = $(".cpxq-01-text"); contentDiv.eq(0).show().siblings().hide(); $('.p102-pro-content-nav li').on('click', function () { var indexsi = $(this).index(); if (!$(this).hasClass("cur")) { contentDiv.eq(indexsi).show().siblings().hide(); $(this).addClass("cur").siblings("li").removeClass("cur"); } }); }); $(function () { $(".p102-pro-case-list").slide({ titCell: ".p102-pro-case-paging li", mainCell: ".p102-pro-case-con", effect: "left", autoPlay: true, vis: 1, interTime: 3000, titOnClassName: "cur" }); }); $(function () { var time; //var winHeight = top.window.document.body.clientHeight || $(window.parent).height(); $('.client-2').css({ 'marginTop': -($('.client-2').height() / 2) }); $('#client-2 li').on({ 'mouseenter': function () { var scope = this; time = setTimeout(function () { var divDom = $(scope).children('div'); var maxWidth = divDom.width(); $(scope).stop().animate({ left: 77 - maxWidth }, 'normal', function () { var pic = $(scope).find('.my-kefu-weixin-pic'); if (pic.length > 0) { pic.show(); } }); }, 100) }, 'mouseleave': function () { var pic = $(this).find('.my-kefu-weixin-pic'); var divDom = $(this).children('div'); var maxWidth = divDom.width(); if (pic.length > 0) { pic.hide(); } clearTimeout(time); var divDom = $(this).children('div'); $(this).stop().animate({ left: 0 }, "normal", function () { }); } }); //杩斿洖椤堕儴 $(window).scroll(function () { var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; var eltop = $("#client-2").find(".my-kefu-ftop"); if (scrollTop > 0) { eltop.show(); } else { eltop.hide(); } }); $("#client-2").find(".my-kefu-ftop").click(function () { var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (scrollTop > 0) { $("html,body").animate({ scrollTop: 0 }, "slow"); } }); });