Project Info
Project Description
jQuery(function ($) { $('.header_mid_inner .mid_nav_wrap .menu-main-menu-bg-container #navigation').append('
') $('.resp_mid_nav_wrap').prepend('
') }); jQuery(function ($) { $('#quickbooking #arrival').datepicker({ autoSize: true, dateFormat: 'dd M yy', beforeShowDay: function (date) { var currentDate = new Date(); currentDate.setHours(0); currentDate.setMinutes(0); currentDate.setSeconds(0); currentDate.setMilliseconds(0); if (date >= currentDate) { return [true, '']; } else { return [false, '']; } }, onSelect: function (dateText, inst) { var nextDay = $('#quickbooking #arrival').datepicker('getDate'); nextDay.setDate(nextDay.getDate() + 1); var depart = $('#quickbooking #departure').datepicker('getDate'); if (depart < nextDay) { $('#quickbooking #departure').val($.datepicker.formatDate('dd M yy', nextDay)); } } }).val($.datepicker.formatDate('dd M yy', new Date())); var nextDay = new Date(); nextDay.setDate(new Date().getDate() + 1); $('#quickbooking #departure').datepicker({ autoSize: true, dateFormat: 'dd M yy', beforeShowDay: function (date) { var nextDay = $('#quickbooking #arrival').datepicker('getDate'); nextDay.setDate(nextDay.getDate() + 1); nextDay.setHours(0); nextDay.setMinutes(0); nextDay.setSeconds(0); nextDay.setMilliseconds(0); if (date >= nextDay) { return [true, '']; } else { return [false, '']; } } }).val($.datepicker.formatDate('dd M yy', nextDay));
$('#quickbooking form').submit(function (e) { e.preventDefault(); var $this = $(this); var url = '';
var values = {}; $.each($this.serializeArray(), function (k, v) { values[v.name] = v.value; }); if (values.hotel == -1) { url = ''; } else { url = 'https://adellaboutiquehotel.book-onlinenow.net/index.aspx?'; } delete values.hotel;
var arrivalDate = $('#arrival', $this).datepicker('getDate'); var departureDate = $('#departure', $this).datepicker('getDate'); values.arrival = $.datepicker.formatDate('dd/mm/yy', arrivalDate); values.departure = $.datepicker.formatDate('dd/mm/yy', departureDate);
$.each(values, function (k, v) { if (v.length > 0) { url += k + '=' + v + '&'; } }); url = url.substr(0, url.length - 1); //uncomment below if results in _self //window.location.href = url;
//comment below if you need result in _self var BookSearch = window.open(url, "_blank"); }); }); //mobile code jQuery(function ($) { $('#quickbookingMobile #arrivalMobile').datepicker({ dateFormat: 'dd M yy', beforeShowDay: function (date) { var currentDate = new Date(); currentDate.setHours(0); currentDate.setMinutes(0); currentDate.setSeconds(0); currentDate.setMilliseconds(0); if (date >= currentDate) { return [true, '']; } else { return [false, '']; } }, onSelect: function (dateText, inst) { var nextDay = $('#quickbookingMobile #arrivalMobile').datepicker('getDate'); nextDay.setDate(nextDay.getDate() + 1); var depart = $('#quickbookingMobile #departureMobile').datepicker('getDate'); if (depart < nextDay) { $('#quickbookingMobile #departureMobile').val($.datepicker.formatDate('dd M yy', nextDay)); } } }).val($.datepicker.formatDate('dd M yy', new Date())); var nextDay = new Date(); nextDay.setDate(new Date().getDate() + 1); $('#quickbookingMobile #departureMobile').datepicker({ dateFormat: 'dd M yy', beforeShowDay: function (date) { var nextDay = $('#quickbookingMobile #arrivalMobile').datepicker('getDate'); nextDay.setDate(nextDay.getDate() + 1); nextDay.setHours(0); nextDay.setMinutes(0); nextDay.setSeconds(0); nextDay.setMilliseconds(0); if (date >= nextDay) { return [true, '']; } else { return [false, '']; } } }).val($.datepicker.formatDate('dd M yy', nextDay));
$('#quickbookingMobile form').submit(function (e) { e.preventDefault(); var $this = $(this); var url = '';
var values = {}; $.each($this.serializeArray(), function (k, v) { values[v.name] = v.value; }); if (values.hotelMobile == -1) { url = ''; } else { url = 'https://adellaboutiquehotel.book-onlinenow.net/index.aspx?'; } delete values.hotelMobile;
var arrivalDate = $('#arrivalMobile', $this).datepicker('getDate'); var departureDate = $('#departureMobile', $this).datepicker('getDate'); values.arrival = $.datepicker.formatDate('dd/mm/yy', arrivalDate); values.departure = $.datepicker.formatDate('dd/mm/yy', departureDate);
$.each(values, function (k, v) { if (v.length > 0) { url += k + '=' + v + '&'; } }); url = url.substr(0, url.length - 1); //uncomment below if results in _self //window.location.href = url;
//comment below if you need result in _self var BookSearch = window.open(url, "_blank"); }); $(window).bind('scroll', function() { if ($(window).scrollTop() >= 45) { $('.booking-button-mobile').css('margin-top', '5px'); } else { $('.booking-button-mobile').css('margin-top', '9px'); } }); });