$(document).ready(function() { $(".about_tab li").hover(function() { $(this).find("a").animate({ lineheight: "100px" }, 300).parent().siblings().find("a").animate({ lineheight: "40px" }, 300) }); $(".jion_tab li").on("mouseenter", function() { $(this).addclass("on").siblings().removeclass("on"); $(".job_tab").eq($(this).index()).show().siblings().hide() }).eq(1).mouseenter(); $(".job_tab li").on("mouseenter", function() { var index = $(this).index(); $(this).addclass("on").siblings().removeclass("on"); $(".job_tab").each(function() { $(this).children(".intro").eq(index).show().siblings(".intro").hide() }) }).eq(0).mouseenter(); setpion($(".culture .wrap")); $(".about_tab li").on("click", function() { var index = $(this).index(); var top = $(".about_title").eq(index).offset().top; $('html,body').animate({ scrolltop: top }, 500) }); picrank($(".fly")) }); $(window).scroll(function() { move($(".culture .wrap")); if ($(window).scrolltop() < 100) { $(".about_tab li").eq(0).find("a").animate({ lineheight: "100px" }, 300).parent().siblings().find("a").animate({ lineheight: "40px" }, 300) } }); function setpion(o) { var l = o.find(".fl"); var r = o.find(".fr"); var wd = $(window).width(); l.css({ left: wd, top: -200 }); r.css({ left: -wd, top: -200 }) } function move(o) { var l = o.find(".fl"); var r = o.find(".fr"); var height = $(window).height(); var scroll = $(window).scrolltop() - 100; var top = o.offset().top; if (top - scroll < height) { l.animate({ left: 0, top: 0 }, 600); r.animate({ left: 0, top: 0 }, 600, function() { $(this).find("img").css({ transform: "rotatex(-360deg)", transition: "all .6s ease-in-out" }) }) } } function picrank(o) { var e = o.find("img"); e.css({ opacity: 0, right: 0, top: "-400px" }); var place = [ [243, 0], [0, 81], [81, 81], [162, 81], [243, 81], [324, 81], [405, 81], [242, 162], [162, 243], [324, 243], [81, 324], [324, 324], [0, 403], [240, 404] ]; e.each(function(i) { var x = place[i]; var n; if (x) { $(this).delay(i * 120).animate({ left: x[0], top: x[1], opacity: 1 }, 500) } }) }