/*==============================================
�y�[�W�������N
==============================================*/
jQuery(function() {
jQuery("a[href^=#]").click(function(){
var elmID = jQuery(this).attr("href");
var posi = 0;
if(jQuery(elmID).size()){
posi = jQuery(elmID).offset().top -0;
BodySlider(posi);
return false;
}
});
function BodySlider(HashOffset){
jQuery("html,body").animate({
scrollTop: HashOffset
}, 600);
}
});
/*==============================================
page top
==============================================*/
//���g�b�v�֖߂遫
jQuery(function() {
var topBtn = jQuery('.page_top');
topBtn.hide();
//�X�N���[����200�ɒB������{�^���\��
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() > 200) {
topBtn.fadeIn();
} else {
topBtn.fadeOut();
}
});
});
/*==============================================
�X���C�h�V���[
==============================================*/
$(function() {
$('.slider').slick({
prevArrow: '',
nextArrow: '',
infinite: true,
dots: false,
slidesToShow: 1,
centerMode: true, //�v�f�𒆉���
centerPadding:'0', //���T�C�h�̌����Ă��镔���̃T�C�Y
autoplay:true, //������
responsive: [{
breakpoint: 480,
settings: {
centerMode: true,
}
}]
});
});
/*==============================================
accordionbox�@trip
==============================================*/
$(function(){
$(".accordionbox dt").on("click", function() {
$(this).next().slideToggle();
// active�����݂���ꍇ
if ($(this).children(".accordion_icon").hasClass('active')) {
// active���폜
$(this).children(".accordion_icon").removeClass('active');
}
else {
// active��lj�
$(this).children(".accordion_icon").addClass('active');
}
});
});
// �A�R�[�f�B�I���J��
$('.accordion').on('click',function(){
var $this = $(this);
if( $this.hasClass('close') ){
if( $this.hasClass('jsScroll') ){
// �X�N���[��������
var scrTop = $this.offset().top;
var delay = Math.abs(scrTop - $(window).scrollTop());
$('html,body').animate({ scrollTop: scrTop }, delay);
// �A�R�[�f�B�I���J��
setTimeout(function(){
$this.removeClass('close').next().stop().slideDown(450);
}, delay);
}
else $this.removeClass('close').next().stop().slideDown(450);
}
else{
$this.next().stop().slideUp(450,function(){ $this.addClass('close'); });
}
});
$('.accClose').on('click',function(){
var $accordion = $(this).parent().prev();
if( $accordion.hasClass('accordion') ) $accordion.trigger('click');
});
/*==============================================
accordionbox�@beach&ubud
==============================================*/
var itemHeights = [];
var returnHeight;
$(function(){
$(".grad-item").each(function(){ //�^�[�Q�b�g(�k�߂�A�C�e��)
var thisHeight = $(this).height(); //�^�[�Q�b�g�̍������擾
itemHeights.push(thisHeight); //���ꂼ��̍�����z��ɓ����
$(this).addClass("is-hide"); //CSS�Ŏw�肵�������ɂ���
returnHeight = $(this).height(); //is-hide�̍������擾
});
});
$(".grad-trigger").click(function(){ //�g���K�[���N���b�N������
if(!$(this).hasClass("is-show")) {
var index = $(this).index(".grad-trigger"); //�g���K�[�����ڂ�
var addHeight = itemHeights[index]; //���ɑΉ����鍂�����擾
$(this).addClass("is-show").next().animate({height: addHeight},200).removeClass("is-hide"); //���������ɖ߂�
} else {
$(this).removeClass("is-show").next().animate({height: returnHeight},200).addClass("is-hide"); //�����𐧌�����
}
});