(function ($) { $.fn.showHide = function (options) { //default vars for the plugin var defaults = { speed: 1000, easing: '', changeText: 0, showText: 'Show', hideText: 'Hide' }; var options = $.extend(defaults, options); $(this).click(function () { // optionally add the class .toggleDiv to each div you want to automatically close $('.toggleDiv').slideUp(options.speed, options.easing); // this var stores which button you've clicked var toggleClick = $(this); // this reads the rel attribute of the button to determine which div id to toggle var toggleDiv = $(this).attr('rel'); // here we toggle show/hide the correct div at the right speed and using which easing effect $(toggleDiv).slideToggle(options.speed, options.easing, function() { // this only fires once the animation is completed if(options.changeText==1){ $(toggleDiv).is(":visible") ? toggleClick.text(options.hideText) : toggleClick.text(options.showText); } }); return false; }); }; })(jQuery); $(document).ready(function(){ $('.terms-trigger-alt').click(function () { $(this).attr('aria-expanded', ($(this).attr('aria-expanded') == 'false') ? 'true' : 'false'); var $main = $(this).parent(); if ( $main.hasClass('active') ) { $main.removeClass('active'); } else { $main.addClass('active'); } }); $(".conciergeme").click( function() { var href =$(this).attr("data-href"); window.parent.location = href; }); $("#switcher span").click( function() { var $this = $(this); if ( $this.hasClass('one') ) { $this.css('display', 'none'); $('#work-desc').css('display', 'none'); $('#switcher span.two').css('display', 'inline'); $('#artist-desc').css('display', 'block'); } else { $this.css('display', 'none'); $('#artist-desc').css('display', 'none'); $('#switcher span.one').css('display', 'inline'); $('#work-desc').css('display', 'block'); } }); $(".dropcontainer").on('click', function(){ $(".datepickeron").removeClass("super-ghost").css({"opacity" : 1, "visibility" : "visible"}); }); $( "#departure_dates" ).on('click', function(){ $(".datepickeron").addClass("super-ghost"); }); $(".partners-box").click(function() { var id=$(this).attr("data-id"); if($(this).hasClass("activeslide")) { $(this).removeClass("activeslide"); $("#"+id).slideUp(500); }else{ $(".partners-box").removeClass("activeslide"); $(".toggleDiv").fadeOut(100); $("#"+id).slideDown(500); $(this).addClass("activeslide"); } }); var width = $('.function_rooms').width(); $(".room_information").css("width",width); $('table.function_rooms td').hover(function() { $(this).parents('table').find('col:eq('+$(this).index()+')').toggleClass('hover'); }); $('.lightbox').nivoLightbox(); $('ul.tabs').each(function(){ // For each set of tabs, we want to keep track of // which tab is active and it's associated content var $active, $content, $links = $(this).find('a'); // If the location.hash matches one of the links, use that as the active tab. // If no match is found, use the first link as the initial active tab. $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]); $active.addClass('active'); $content = $($active[0].hash); // Hide the remaining content $links.not($active).each(function () { $(this.hash).hide(); }); // Bind the click event handler $(this).on('click', 'a', function(e){ // Make the old tab inactive. $active.removeClass('active'); $content.hide(); // Update the variables with the new link and content $active = $(this); $content = $(this.hash); // Make the tab active. $active.addClass('active'); $content.show(); // Prevent the anchor's default click action e.preventDefault(); }); }); $(window).resize(function() { var width = $('.function_rooms').width(); $(".room_information").css("width",width); }); $(".func_rooms").click(function(event){ var pos=event.pageY; var posi = pos ; var id=$(this).attr("id"); var content = $(".view_info").html(); $(this).find(".room_information").html(content); $(".room_information").fadeOut(100); $(this).find(".room_information").fadeIn(200); $(".view_info_close").click(function(){ $(this).parent().parent().hide(); return false; }); }); $('#map-side-bar li').on('click', function(){ $('#map-side-bar').find('li').removeClass('active'); $(this).addClass('active').siblings().removeClass('active'); }); $(".infocontainer a.closer").click(function(evt) { $(".infocontainer").stop().hide(500); $(".infocontainer").removeClass("boooyah"); evt.preventDefault(); }); $(".map-link").click("click", function() { $(".infocontainer").stop().hide(500); $("#infocontainer" + $(this).attr("rel")).stop().show(500); e.preventDefault(); }); $(".title").click(function() { $(".allothers li").removeClass("yesssss"); $("li.stater-title").addClass("yesssss"); }); }); $(document).ready(function() { /* OWL CAROUSEL */ var owlie = function() { $('.owlie').owlCarousel({ loop:true, margin:10, nav:true, navText: [ '', '' ], smartSpeed: 1000, responsive:{ 0:{ items:1 }, 960:{ items:2 }, } }); } owlie(); $(window).resize(function() { owlie(); }); /* SLICK NAV */ /* $('.editionSlider').slick({ slidesToShow: 2, slidesToScroll: 1, initialSlide: 1, centerMode: true, speed: 1000, easing: 'jswing', // check jquery.easing website prevArrow: '
', nextArrow: '', responsive: [ { breakpoint: 769, settings: { slidesToShow: 1, slidesToScroll: 1, } } ] }); */ /* IOSSLIDER */ $('.iosSlider').iosSlider({ snapToChildren: true, desktopClickDrag: true, infiniteSlider: true, snapSlideCenter: true, onSlideChange: slideChange, autoSlideTransTimer: 2000, keyboardControls: true, onSlideComplete: slideComplete, navNextSelector: $('.iosslider-next'), navPrevSelector: $('.iosslider-prev'), }); function slideComplete(args) { $('.iosslider-next, .iosslider-prev').removeClass('unselectable'); if(args.currentSlideNumber == 1) { $('.iosslider-prev').addClass('unselectable'); } else if (args.currentSliderOffset == args.data.sliderMax) { $('.iosslider-next').addClass('unselectable'); } } function slideChange(args) { /* try { console.log('changed: ' + (args.currentSlideNumber - 1)); } catch(err) {} $('.indicators .item').removeClass('selected'); $('.indicators .item:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected'); $('.slideSelectors .item').removeClass('selected'); $('.slideSelectors .item:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected'); */ $('.iosSlider .item').removeClass('current'); $(args.currentSlideObject).addClass('current'); } $('.iosSlider').bind('mousewheel', function(event, delta) { var currentSlide = $('.iosSlider').data('args').currentSlideNumber; // if delta is a positive number, go to prev slide. If delta is a negative number, go to next slide. if(delta > 0) { $('.iosSlider').iosSlider('goToSlide', currentSlide - 1); } else { $('.iosSlider').iosSlider('goToSlide', currentSlide + 1); } }); /* TIER BOX */ $('.content-hang').bind('inview', function (event, visible) { if (visible == true) { $(this).addClass("thereitis"); } }); $('.related_rooms').bind('inview', function (event, visible) { if (visible == true) { $(this).addClass("showmetheroom"); } }); $('.tierbox').bind('inview', function (event, visible) { if (visible == true) { $(this).addClass("tierbox--show"); } }); $(".gallery-cat-mobile a").on('click', function(e){ e.preventDefault(); $(".gallery-menu").toggleClass('show'); }); /* OWL CAROUSEL SUB-DESTINATIONS*/ /* var owlie = function() { $('.destinations-slider-ul').owlCarousel({ loop:true, margin:10, nav:true, navText: [ '', '' ], smartSpeed: 1000, responsive:{ 0:{ items:1 }, 960:{ items:1 }, } }); } owlie(); $(window).resize(function() { owlie(); }); */ }); $("body").click(function(e) { if (e.target.className !== "activetrigger_demo3") { $(".dropcontainer_demo3").removeClass('swayup'); $(".dropcontainer_demo3").addClass('swaydown'); $(".dropcontainer_demo3 ul").removeClass('dropdownvisible_demo3'); $(".dropcontainer_demo3 ul").addClass('dropdownhidden_demo3'); } if (e.target.className !== "activetrigger_demo2") { $(".dropcontainer_demo2").removeClass('swayup'); $(".dropcontainer_demo2").addClass('swaydown'); $(".dropcontainer_demo2 ul").removeClass('dropdownvisible_demo2'); $(".dropcontainer_demo2 ul").addClass('dropdownhidden_demo2'); } if (e.target.className !== "activetrigger") { $(".dropcontainer ul").removeClass('dropdownvisible'); $(".dropcontainer ul").addClass('dropdownhidden'); } });