var index = 0; $(function(){ var header = $('#header'); header.find('.depth1 a').bind({ click: function() { var index = header.find('.depth1 a').index(this); if(index<7){ header.find('.depth2').show().find('ul').hide().eq(index).show(); }else{ header.find('.depth2').hide().find('ul').hide() } }, mouseenter: function() { var index = header.find('.depth1 a').index(this); if(index<7){ header.find('.depth2').show().find('ul').hide().eq(index).show(); }else{ header.find('.depth2').hide().find('ul').hide() } } }); header.mouseleave(function(){ header.find('.depth2').hide().find('ul').hide() }); header.find('.sns p a').click(function(){ pop_open_modal('/sub/reservation.php'); }); $(".main_bar .btn").click(function (){ try{ parallax.moveIndexPage(1); }catch(e){} }); $('.sns ul li.call').mouseenter(function(){ $(this).find('a img').css('visibility','hidden'); $(this).find('.call_on').show(); return false; }); $('.sns ul li.call .call_on').mouseleave(function(){ $(this).prev().find('img').css('visibility','visible'); $(this).hide(); return false; }); /* $(".btn_more").mousedown(function (e){ addBlog(); var clone = $(".blog_list").find("ul").eq(0).clone(); clone.appendTo($(".blog_list")); }); */ $('.scroll_nav').css('marginTop',function(){ return -(parseInt($('.scroll_nav').height()/2)); }); if($('.flexslider').length>0){ $('.flexslider').flexslider({ animation: "slide", slideshow: false, start: function(){ $('.flexslider').each(function(){ if($(this).find('.slides img').length != 1){ $(this).find('.count .total').text($(this).find('.flex-control-paging li').length); $(this).find('.count .current').text($(this).find('.flex-control-paging .flex-active').text()); }else{ $(this).find('.count .total').text('1'); $(this).find('.count .current').text('1'); } }); }, after:function(){ $('.flexslider').each(function(){ $(this).find(' .count .current').text($(this).find('.flex-control-paging .flex-active').text()); }); } }); }; $('.txt_type').css('marginTop',function(){ return -(parseInt($('.txt_type').height()/2)); }); mini_nav(); $(window).scroll(function(){ mini_nav(); }); main_img(); $('.slideImg img').eq(0).load(function(){ main_img(); }); $(window).resize(function(){ main_img(); }); $(".btn_prev").click(function (){ index--; if(index < 0)index = 0; setIndex(index); }); $(".btn_next").click(function (){ index++; if(index > _total){ index = _total; } setIndex(index); }); $('.main_bar .thum_list li a').click(function(){ if($('.mainFade img:animated').length<1){ var index = $('.main_bar .thum_list li a').index(this); $('.mainFade img').eq(index).css('zIndex','4'); clearInterval(fade); clearInterval(fade2); xMain = index; fadeMain(index); fade2 = setInterval("fadeMain(xMain)",4000); } return false; }); if(getBrowserName() == "iPad") paticle_init(); if(getBrowserName() == "iPhone") paticle_init(); if(getBrowserName() == "Android") paticle_init(); if(_subPage == "reservation") pop_open_modal('/sub/reservation.php'); }); var fade2; var fade = setInterval("fadeMain(xMain)",4000); var xMain = 1; function fadeMain(aa){ $('.main_bar .thum_list li a').removeClass('current').eq(aa).addClass('current'); $('.mainFade img').eq(aa).css('zIndex','4') $('.mainFade img.current').animate({opacity:0},1300,function(){ $('.mainFade img').eq(aa).css('zIndex','5').addClass('current'); $(this).css({zIndex:'1',opacity:'1'}).removeClass('current'); }); $('.mainFade .txt_type').fadeOut().eq(aa).fadeIn(); if(xMain == 3){ xMain = 0; }else{ xMain = xMain+1; } } function setIndex($index){ //console.log("index : " + $index); index = $index; try{ parallax.moveIndexPage($index); parallax.moveIndexPage($index); }catch(e){} } function buttonChange($index) { //console.log($index); var idx = $index; for(var i=1;i<=_total;i++){ if(i == idx){ $(".scroll_nav").find("ul li a").eq(i-1).addClass("ul li a current"); index = i; }else{ $(".scroll_nav").find("ul li a").eq(i-1).removeClass("ul li a current"); } } } function mini_nav(){ var top = $(window).scrollTop(); if(top>100){ $('.mini_nav').fadeIn(500); }else{ $('.mini_nav').fadeOut(200); } } function call_off(){ $('.sns ul li.call a img').css('visibility','visible'); $('.sns ul li.call .call_on').hide(); } function main_img(){ var slideImg = $('.slideImg'); var wid = slideImg.width(); var hei = parseInt($(window).height()-154); slideImg.css('height',hei); if(hei>700){ slideImg.find('img').css({width:'auto',height:hei}); }else{ slideImg.find('img').css({width:'2000px',height:'auto'}); } slideImg.find('img').css({marginTop:-(parseInt(slideImg.find('img').height()/2)),marginLeft:-(parseInt(slideImg.find('img').width()/2))}) } function pop_open_modal(objName,posStatic){ var static_posY = posStatic; var dHeight = $(document).height(); var sHeight = $(document).scrollTop(); var zPosition = $('body .popBg').length; $('html').css('overflow-y','scroll'); $('
').appendTo('body'); $('.popBg').css({width:'100%',height:dHeight}); $(window).resize(function(){ $('.popBg').css({width:'100%'}); }); $('').appendTo('body'); $('.popModal:last').load(objName,function(){ var wHeight = $(window).height(); var posX = $('.popModal:last').find('#popWrap').width(); var posY = $('.popModal:last').find('#popWrap').height(); var posTop = (sHeight+wHeight/2)-posY/2; var dMax = $(document).height()-posY; if(posTop <=0){posTop=0;} if(posTop