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= 0) { lsBrowser = "MSIE"; } else if (lsBrowser.indexOf("Firefox") >= 0) { lsBrowser = "Firefox"; } else if (lsBrowser.indexOf("Chrome") >= 0) { lsBrowser = "Chrome"; } else if (lsBrowser.indexOf("Safari") >= 0) { lsBrowser = "Safari"; if (navigator.userAgent.indexOf("iPhone") >= 0){lsBrowser = "iPhone";} if (navigator.userAgent.indexOf("iPad") >= 0){lsBrowser = "iPad";} if (navigator.userAgent.indexOf("Android") >= 0){lsBrowser = "Android";} } else if (lsBrowser.indexOf("Opera") >= 0) { lsBrowser = "Opera"; } else { lsBrowser = "UNKNOWN"; } if(lsBrowser == "Chrome"){ //lsBrowser = "Android"; } return lsBrowser; } function paticle_init() { $("#cate1_object01").css({"position":"absolute", "left":$(window).width()/2 + 450, "top":-235}).hide(); $("#cate1_object02").css({"position":"absolute", "left":$(window).width()/2 - 200, "top":0}).hide(); $("#cate1_object03").css({"position":"absolute", "left":$(window).width()/2 + 480, "top":268}).hide(); $("#cate1_object04").css({"position":"absolute", "left":$(window).width()/2 + 0, "top":452}).hide(); $("#cate1_object05").css({"position":"absolute", "left":-100, "top":730}).hide(); $("#cate1_object06").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":856}).hide(); $("#cate2_object01").css({"position":"absolute", "left":$(window).width()/2 + 600, "top":25}).hide(); $("#cate2_object02").css({"position":"absolute", "left":$(window).width() - 100, "top":132}).hide(); $("#cate2_object03").css({"position":"absolute", "left":$(window).width()/2 + 700, "top":500}).hide(); $("#cate2_object04").css({"position":"absolute", "left":$(window).width()/2 - 450, "top":870}).hide(); $("#cate2_object05").css({"position":"absolute", "left":$(window).width()/2 - 700, "top":800}).hide(); $("#cate2_object06").css({"position":"absolute", "left":$(window).width()/2 + 750, "top":792}).hide(); $("#cate3_object01").css({"position":"absolute", "left":$(window).width()/2 + 750, "top":700}).hide(); $("#cate3_object02").css({"position":"absolute", "left":$(window).width()/2 - 200, "top":800}).hide(); $("#cate3_object03").css({"position":"absolute", "left":$(window).width()/2 - 200, "top":800}).hide(); $("#cate4_object01").css({"position":"absolute", "left":$(window).width()/2 + 450, "top":-235}).hide(); $("#cate4_object02").css({"position":"absolute", "left":$(window).width()/2 + 500, "top":368}).hide(); $("#cate4_object03").css({"position":"absolute", "left":$(window).width()/2 - 900, "top":545}).hide(); $("#cate4_object04").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#cate5_object01").css({"position":"absolute", "left":$(window).width()/2 + 450, "top":-235}).hide(); $("#cate5_object02").css({"position":"absolute", "left":$(window).width()/2 + 500, "top":368}).hide(); $("#cate5_object03").css({"position":"absolute", "left":$(window).width()/2 - 900, "top":545}).hide(); $("#cate5_object04").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#cate5_object05").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#cate5_object06").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#cate6_object01").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#cate6_object02").css({"position":"absolute", "left":$(window).width()/2 - 600, "top":828}).hide(); $("#paticle01").css({"position":"absolute", "left":$(window).width()/2 - 1400/2, "top":100}).hide(); $("#paticle02").css({"position":"absolute", "left":$(window).width()/2 + 1400/2, "top":600}).hide(); $("#paticle03").css({"position":"absolute", "left":$(window).width()/2 + 1200/2, "top":600}).hide(); }