function homepageText() { var $hT = $(".homepage-text"), //$hO = $(".homepage-operation"), winWidth = $(window).width(); //校对homepage-text居中 $hT.css({ "left": winWidth / 2 - $hT.width() / 2 }); //校对banner上四块盈科新闻居中 //var hOTop = $hT.height() + 100; //$hO.css({ // "left": winWidth / 2 - $hO.width() / 2 //}); } //专业委员会 function zYLY() { var $pUl = $(".parallax_zyly .pz_ul"), //专业领域集合 $zlList = $(".parallax_zyly .zyly_list"), //单个专业领域 $pzCn = $(".parallax_zyly .pz_cn"), //专业委员会整体区域 $pzLi = $(".parallax_zyly .pz_li"), //专业委员会 $pzNeedle = $(".parallax_zyly .pz_needle"), //小箭头 $zlShow = $(".parallax_zyly .zl_show"); //当前选中的a //定义专业领域所在位置居中 $pUl.css("left", $(window).width() / 2 - $pUl.width() / 2); //显示第一个专委会 $pzLi.eq(0).show(); //内容动画 //变量声明 var num = 0; var zlCnLastIndex = $zlList.length - 1; var pzWidth = $pzCn.width(); //内容显示的宽 var firstleft = $zlList.eq(0).offset().left; //内容起始位置 var lastright = $zlList.eq(zlCnLastIndex).offset().left + $zlList.eq(zlCnLastIndex).width(); //内容终点位置 var cWidth = $zlList.eq(0).offset().left + $zlList.eq(0).width() / 2 - $pzNeedle.width() / 2; //箭头初始位置 //初始化位置 $pzCn.css("left", firstleft); $pzNeedle.css("left", cWidth); if ($(document).width() >= 1207) { $zlList.eq(num).addClass("zl_show"); } else { $zlList.removeClass("zl_show"); } $zlList.hover(function () { num = $(this).index(".parallax_zyly a"); if ($(document).width() >= 1207) { $pzLi.hide(); $pzLi.eq(num).show(); var left = $(this).offset().left; var pnLeft = left + $(this).width() / 2; var pzLeft = left + $(this).width() / 2 - pzWidth / 2 + 20; //判断是否超出居中-----左 var ulLeft = pzLeft > firstleft ? pzLeft : firstleft; //判断是否超出居中-----右 ulLeft = lastright < ulLeft + pzWidth ? lastright - pzWidth + 20 : ulLeft; $pzCn.stop().animate({ left: ulLeft }, 200); $pzNeedle.stop().animate({ left: pnLeft }, 300); $zlList.removeClass("zl_show"); $zlList.eq(num).addClass("zl_show"); } else { $zlList.removeClass("zl_show"); } }); $(window).resize(function () { $pUl.css("left", $(window).width() / 2 - $pUl.width() / 2); firstleft = $zlList.eq(0).offset().left; //内容起始位置 lastright = $zlList.eq(zlCnLastIndex).offset().left + $zlList.eq(zlCnLastIndex).width(); //内容终点位置 var pnLeft = $zlList.eq(num).offset().left + $zlList.eq(num).width() / 2 - $pzNeedle.width() / 2; //箭头位置 var left = $zlList.eq(num).offset().left; var pzLeft = left + $zlList.eq(num).width() / 2 - pzWidth / 2 + 20; //判断是否超出居中-----左 var ulLeft = pzLeft > firstleft ? pzLeft : firstleft; //判断是否超出居中-----右 ulLeft = lastright < ulLeft + pzWidth ? lastright - pzWidth + 20 : ulLeft; $pzCn.css("left", ulLeft); $pzNeedle.css("left", pnLeft); if ($(document).width() >= 1207) { $zlList.eq(num).addClass("zl_show"); } else { $zlList.removeClass("zl_show"); } }); $(".zl_cn a").click(function () { $(".zl_cn").click(); }); }; //$(function () { // //页面完成前的动画 // setTimeout(function () { // $("#loading").fadeOut("1000", function () { // // Animation complete // $('#loading img').css("display", "none"); // $('#loading').css("display", "none"); // $('#loading').css("background", "none"); // $('#loading').css("width", "0"); // $('#loading').css("height", "0"); // }); // }, 2000); //}); $(window).load(function () { $("#loading").fadeOut("1000", function () { // Animation complete $('#loading img').css("display", "none"); $('#loading').css("display", "none"); $('#loading').css("background", "none"); $('#loading').css("width", "0"); $('#loading').css("height", "0"); }); }); $(function () { //banner图动画 $.supersized({ // Functionality slideshow: 1, // Slideshow on/off autoplay: 1, // Slideshow starts playing automatically start_slide: 1, // Start slide (0 is random) stop_loop: 0, // Pauses slideshow on last slide random: 0, // Randomize slide order (Ignores start slide) slide_interval: 6000, // Length between transitions transition: 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left transition_speed: 1500, // Speed of transition new_window: 1, // Image links open in new window/tab pause_hover: 0, // Pause slideshow on hover keyboard_nav: 1, // Keyboard navigation on/off performance: 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) image_protect: 1, // Disables image dragging and right click with Javascript // Size & Position min_width: 0, // Min width allowed (in pixels) min_height: 0, // Min height allowed (in pixels) vertical_center: 1, // Vertically center background horizontal_center: 1, // Horizontally center background fit_always: 0, // Image will never exceed browser width or height (Ignores min. dimensions) fit_portrait: 1, // Portrait images will not exceed browser height fit_landscape: 0, // Landscape images will not exceed browser width // Components slide_links: 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank') thumb_links: 1, // Individual thumb links for each slide thumbnail_navigation: 0, // Thumbnail navigation slides: [ // Slideshow Images //设置需要轮换的图片 //{ image: '5.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/5.jpg*/, title: 'Dreamer - Responsive One Page Parallax Template' }, // { image: '1.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/1.jpg*/, title: 'Dreamer - Responsive One Page Parallax Template' }, // { image: '2.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/2.jpg*/, title: 'Dreamer - Responsive One Page Parallax Template' }, // { image: '3.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/3.jpg*/, title: 'Dreamer - Responsive One Page Parallax Template' }, // { image: '2.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/2.jpg*/, title: 'Dreamer - Responsive One Page Parallax Template' }, { image: '6.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/6.jpg*/, title: '' }, { image: '3.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/homepage/homepage-slideshow/3.jpg*/, title: '' } // { image: 'yuandan_banner_1.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/index/banner/yuandan_banner_1.jpg*/, title: 'img1' }, // { image: 'yuandan_banner_2.jpg'/*tpa=https://www.yingkelawyer.com/Scripts/index/Image/index/banner/yuandan_banner_2.jpg*/, title: 'img2' } //{ image: 'https://www.yingkelawyer.com/Scripts/index/Image/index/banner/2023-xinchun.jpg?v=20230110', title: '2023 新春' } ], // Theme Options progress_bar: 1, // Timer for each slide mouse_scrub: 0 }); //模拟文本控件的placeholder属性,用于不支持placeholder属性的浏览器 if (!isplaceholder()) { placeholderFocus($("#text_name")); placeholderFocus($("#text_phone")); placeholderFocus($("#text_mail")); placeholderFocus($("#text_company")); placeholderFocus($("#text_type")); placeholderFocus($("#text_part")); } var windowsize; //校对banner中内容的位置居中 homepageText(); //当前页面宽度 $(window).resize(function () { windowsize = $(window).width(); homepageText(); //banner以下距顶距离 $('#content-container').css("margin-top", $(window).height()); }); $("#bottom-icon").click(function () { //点击banner上bottom-icon按钮时,向下滚动1屏 $("html,body").stop().animate({ scrollTop: $("#content-container").offset().top - 50 }, 800); }); //初始化让homepage-text显示 $('#content-container').css("margin-top", $(window).height()); if (windowsize > 1024) { //如果窗口大于1024像素,然后加载一个轨道上设置 //视差(xPosition speedFactor outerHeight)选项: //xPosition -水平位置的元素 //惯性——速度相对于垂直滚动。例子:0.1是十分之一滚动的速度,2是滚动速度的两倍 //outerHeight(真/假),jQuery是否应该使用它的outerHeight选项决定当一个部分在视窗 $('.parallax-one').parallax("50%", 0); } zYLY(); //盈科机构 $.Organization(); loadIndexTabloid();//加载图片新闻 }); function loadIndexTabloid() { var data = [ { name: '聚焦民生改善,助力法治建设', date: '2023年05月06日', imgUrl: '1.png'/*tpa=https://www.yingkelawyer.com/Image/index/tabloid/20230512/1.png*/, hrefUrl: 'https://www.yingkelawyer.com/ykdt/view/74f050a8184caa439ef758497f209ef105806d8ab423be6f125918b7cb11923e6cc846f8b4733c0acd2deeda21602bc1415f1765cf9c1a44f616347c7b3e9600c77200024ccf27b4518624111d9209e84e0b0415a50416f0.html' }, { name: '“锐意创新,共创未来”2023年世界知识产权日主题交流活动在盈科重庆顺利召开', date: '2023年05月05日', imgUrl: '2.png'/*tpa=https://www.yingkelawyer.com/Image/index/tabloid/20230512/2.png*/, hrefUrl: 'https://www.yingkelawyer.com/ykdt/view/2371ff8e8a9edd64481882bde7e0ff284c3c70a9fd81c678ba3391ac0e525eed03b334b8ce25a15f332a29d352364e738b99a3a000b35f41589096b3882877534d56faf5574860adcf53f0a5ca3032a97e3ed88fdaa4e7ce.html' }, { name: '盈科全国碳达峰碳中和法律服务中心2023年度大会圆满召开', date: '2023年04月28日', imgUrl: '3.png'/*tpa=https://www.yingkelawyer.com/Image/index/tabloid/20230512/3.png*/, hrefUrl: 'https://www.yingkelawyer.com/ykdt/view/b7e95b555799bc156b37f25de2deacdb7759b62eab03ca663dc17bd3d0f8528d913fa35e460de42ec5b16346575d4173af39c742ffe5397ac7858a956197120a49fb46b6195c2a4f9bf2210295efa4bf.html' }, { name: '盈科律师事务所和上海交通大学安泰经济与管理学院达成战略合作', date: '2023年04月25日', imgUrl: '4.png'/*tpa=https://www.yingkelawyer.com/Image/index/tabloid/20230512/4.png*/, hrefUrl: 'https://www.yingkelawyer.com/ykdt/view/fa273a28d856e8d3c99fd0747e3841c70ba91164c521b6fc21bb0bed835f372483dc16b9c50296a73889f198a5fa4404adcfe124c9f687ba981f435546ab88041b5fdbd0256c4db3bfa16e91cab70fd3b1e605f2e910daf0.html' }, ]; var html = new Array(); html.push(''); $("#tabloid_index").html(html.join('')); }