$(document).ready(function(){
$("a.anchorLink").anchorAnimate();
//opeingAnimate();
reSizeDIV();
reworkCounsel();
});
$(window).resize(function(){
reSizeDIV();
});
$(window).load(function(){
openingAnimate();
})
//GNB Act
$(window).scroll(function(){
var scrollNum = $(window).scrollTop();
var screenHeight = $(window).height();
var contensScroll = $('.contentsType').eq(1).offset().top;
//console.log(contensScroll)
var menuSel = parseInt(scrollNum/screenHeight);
$('#GNB li').removeClass('Select')
$('#GNB li').eq(menuSel).addClass('Select')
if( contensScroll <= scrollNum ){
$('#GNB').fadeIn('fast');
}else{
$('#GNB').fadeOut('fast');
}
});
function openingAnimate(){
$('.bgPorpomence').fadeOut('slow','',function(){
$('#intro h1').fadeIn(360, function(){
$('#intro h2').fadeIn(220, function(){
$('#intro p').fadeIn(280, function(){
$('#intro button').fadeIn('fast',function(){
var nowScroll = $(window).scrollTop();
if( nowScroll == 0){
setTimeout("slidingLocation('education')",'1000')
}
})
})
})
})
});
};
function reSizeDIV(){
var screenHeight = $(window).height();
//console.log(screenHeight);
$('.contentsType').css('min-height',screenHeight+'px');
$('.contentsType > div').each(function(){
var contentsHegiht = $(this).height();
var contentsPadding = (screenHeight - contentsHegiht)/2;
$(this).css({'padding-top':contentsPadding+'px','padding-bottom':contentsPadding+'px'});
})
}
//top 버튼 및 스크롤 액션 슬라이딩
jQuery.fn.anchorAnimate = function(settings) {
settings = jQuery.extend({
speed : 450
}, settings);
return this.each(function(){
var caller = this
$(caller).click(function (event) {
event.preventDefault()
var locationHref = window.location.href
var elementClick = $(caller).attr("href")
var destination = $(elementClick).offset().top;
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
window.location.hash = elementClick
});
return false;
})
})
}
function slidingLocation(pointTag){
settings = $.extend({
speed : 450
}. settings);
var movingClick = document.getElementById(pointTag)
var movingSlide = $(movingClick).offset().top;
//console.log(movingSlide)
$('html:not(:animated),body:not(:animated)').animate({scrollTop : movingSlide}, settings.speed);
}
function reworkCounsel(){
$('#counsel link').remove();
$('#counsel table, #counsel td').removeAttr('style')
$('#counsel table, #counsel td').removeAttr('borderColor')
$('#counsel table, #counsel td').removeAttr('border')
$('#counsel table div input').removeAttr('src');
$('#counsel table div input').attr('src','http://nayanet.kr/default/img/gate/counsel_btn01.png');
$('#counsel table div a').remove();
//var btnWrite = '';
//btnWrite += ''
//btnWrite += ''
//$('#counsel table div').html(btnWrite)
}