$(function(){ //new icon var newsTxt = function(){ var newList = $('.newsList ul li'); newList.each(function(){ var pW = $(this).find('p').width(); var spanW = $(this).find('span').width(); if (pW < spanW){ $(this).find('span').addClass('long'); } else { $(this).find('span').removeClass('long'); } }); }; $(window).load(function(){ newsTxt(); }); //?´ë©”?¼ë¬´?¨ìˆ˜ì§‘ê±°ë¶? $(".email_btn").fancybox({ 'width' : 540, 'padding' : 0, 'scrolling': 'no', 'type' : 'iframe', 'onComplete' : function() { $('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height $('#fancybox-content').height($(this).contents().find('body').height()); $.fancybox.resize(); }); } }); //?´ìš©?½ê? $(".clause").fancybox({ 'width' : 540, 'padding' : 0, 'scrolling': 'no', 'type' : 'iframe', 'onComplete' : function() { $('#fancybox-frame').load(function() { // wait for frame to load and then gets it's height $('#fancybox-content').height($(this).contents().find('body').height()); $.fancybox.resize(); }); } }); $('.topGo').bind('click', function(){ $('html, body').animate({ scrollTop:'0' },500, 'easeInOutExpo',function(){ $('header').removeClass('moveSlide'); }); }); $('#eventCon .con .text').matchHeight(); // more btn $('.more').each(function(){ $(this).hover(function(){ $(this).children().children('.plus').transition({rotate:'360deg'}); },function(){ $(this).children().children('.plus').transition({rotate:'0deg'}); }); }); //main slide var mainRoll = function(){ $slickMR = $('.mainRoll'); $slickMR.slick({ infinite: true, autoplay: true, autoplaySpeed: 6000, fade: true, //cssEase: 'linear', //slidesToShow: 1, speed: 800, pauseOnHover:false, pauseOnFocus:false, arrows: false, dots: true }); $('.slick-slide').eq(0).find('.txt').stop().animate({'opacity':'1'},2000); $slickMR.on('afterChange', function(event, slick, currentSlide, nextSlide){ $('.mainRoll .txt').css({'opacity': '0'}); $('.slick-slide').eq(currentSlide).find('.txt').stop().animate({'opacity':'1'},2000,function(){ }); }); }; mainRoll(); //event slide var eventRoll = function(){ $slickEvent = $('.eventRoll'); $slickEvent.slick({ infinite: true, autoplay: true, fade: false, slidesToShow:3, speed: 500, dots: false, arrows: true, prevArrow: $('.left'), nextArrow: $('.right'), responsive: [ { breakpoint: 880, settings: { arrows: true, slidesToShow: 2 } }, { breakpoint: 640, settings: { arrows: true, slidesToShow: 1 } } ] }); }; eventRoll(); //story slide var storytRoll = function(){ $slickstory = $('.storyRoll'); $slickstory.slick({ infinite: true, autoplay: true, fade: true, slidesToShow: 1, speed: 500, dots: true, arrows: false }); }; storytRoll(); //membership var m1 = function(b){ $('#'+b+'').animate({'opacity':'1'},300); $('.rightSet img').transition({opacity:1,scale:1,complete:function(){ $('.leftSet .txt').animate({'padding-top':'0','opacity':'1'},800,'easeOutSine'); $('.more').animate({'opacity':'1'},600); }},1000,'cubic-bezier(.12,.20,.8,-0.24)'); } $('div[id^=sector]').waypoint(function() { var sectorNum = $(this).attr('id'); var depNum = parseInt(sectorNum.substr(6,7)); switch (depNum) { case 1 : m1(sectorNum); break; default : break; } }, { offset: '70%' }); });