1jQuery(document).ready(function ($) { 2 3 "use strict"; 4 5 6 // Helper functions 7 //------------------------------------------------------------------------------- 8 function loadImage(src, f) { 9 var img = new Image(); 10 11 $(img).load(function () { 12 $(this).hide(); 13 if (f) 14 f(img); 15 }).error(function () { 16 return false; 17 }).attr('src', src); 18 } 19 20 function fullscreenFix() { 21 var h = $('body').height(); 22 // set .fullscreen height 23 $(".content-b").each(function (i) { 24 if ($(this).innerHeight() <= h) { 25 $(this).closest(".fullscreen").addClass("not-overflow"); 26 } 27 }); 28 29 var h = $(window).height(); 30 31 $('#awe-plugin-booking').css({'min-height': h - 170}); 32 } 33 34 var buildUrl = function(base, key, value) { 35 var sep = (base.indexOf('?') > -1) ? '&' : '?'; 36 return base + sep + key + '=' + value; 37} 38 39 40 // Rates 41 //------------------------------------------------------------------------------- 42 $('.rate-box').on('mouseover', function(){ 43 $('.rate-box').removeClass('highlight', {duration:500}); 44 $(this).addClass('highlight', {duration:500}); 45 }); 46 47 48 // Room Tabs 49 //------------------------------------------------------------------------------- 50 // Thumbnails 51 $('.room-tabs-gallery').on('click', '.room-tabs-gallery-thumb', function(){ 52 var tabId = $(this).attr('href'); 53 var newImgSrc = $(this).find('img').attr('src'); 54 var imgTitle = $(this).find('img').attr('title'); 55 56 $(tabId + " .room-tabs-gallery-preview").fadeOut(100, function() { 57 $(tabId + " .room-tabs-gallery-preview").attr("src", newImgSrc); 58 $(tabId + " .room-tabs-gallery-preview").attr("title", imgTitle); 59 }).fadeIn(100); 60 61 return false; 62 }); 63 64 65 // room tab 66 $(".room-tabs-gallery-preview-container").on("click", function () { 67 68 //var src = $(this).find("img").data('img'); 69 var src = $(this).find("img").attr('src'); 70 var previewImg = $('<img/>').attr('src', src).addClass('img-responsive'); 71 72 var previewImgWidth; 73 previewImg.load(function () { 74 previewImgWidth = this.width; 75 }); 76 77 var imgTitle = $(this).find('img').attr('title'); 78 79 $('#roomTabsGalleryPreviewModal').modal(); 80 $('#roomTabsGalleryPreviewModal').on('shown.bs.modal', function () { 81 $('#roomTabsGalleryPreviewModal .modal-dialog').css('max-width', previewImgWidth); 82 $('#roomTabsGalleryPreviewModal .modal-body').html(previewImg); 83 $('#roomTabsGalleryPreviewModal .modal-nav .title').html(imgTitle); 84 }); 85 $('#roomTabsGalleryPreviewModal').on('hidden.bs.modal', function () { 86 $('#roomTabsGalleryPreviewModal .modal-body').html(''); 87 }); 88 89 return false; 90 }); 91 92 $('.scrollbar-light').scrollbar(); 93 94 95 // Fixing list group 96 // ------------------------------------------------------------- 97 $('.tab-content').find('.list-group-item').prepend('<i class="fa fa-check-square-o"></i>'); 98 99 100 // Parallax Scrolling 101 //------------------------------------------------------------- 102 var $w = $(window); 103 var reviews = $('.parallax-div'); 104 105 function move($c) { 106 var offset = $c.offset().top; 107 var scroll = $w.scrollTop(); 108 var diff = offset - scroll; 109 var pos = 'center ' + (-diff)*0.2 + 'px'; 110 $c.css({'backgroundPosition':pos}); 111 } 112 113 reviews.waypoint(function() { 114 $w.bind('scroll', function(e){ 115 move(reviews); 116 }); 117 118 },{ 119 offset: '100%' 120 }); 121 122 123 // Counter 124 //------------------------------------------------------------------------------- 125 $('.counter').waypoint(function() { 126 127 $('.counter-number').each(function(){ 128 var numberValue = $(this).data('value'); 129 $(this).animateNumber({number:numberValue}, 2000); 130 }); 131 132 this.destroy() 133 134 }, { 135 offset: '100%', 136 triggerOnce: true 137 }); 138 139 140 // Masonry init 141 //------------------------------------------------------------- 142 $('.grid').masonry({ 143 // options 144 columnWidth: '.grid-sizer', 145 itemSelector: '.grid-item', 146 percentPosition: true 147 }); 148 149 150 // pagination fixing 151 //------------------------------------------------------------- 152 $('#menu-testing-menu').find('.active').removeClass('active'); 153 154 155 // Initialize Tooltip 156 //------------------------------------------------------------- 157 $('.my-tooltip').tooltip(); 158 159 160 // Fixing header logo padding 161 //------------------------------------------------------------- 162 loadImage($('.nav-logo img').attr('src'), function (image) { 163 if (image.naturalHeight < 90) { 164 var paddingTop = (85 - image.naturalHeight) / 2; 165 $('.nav-logo').css({'padding-top': paddingTop}); 166 } 167 }); 168 169 170 171 // Revo slider 172 //------------------------------------------------------------- 173 if ($('#home .rev_slider_wrapper').length>0) { 174 $('body').addClass('revoBody revomenu'); 175 } 176 177 178 // Fixing for page-builder content in page-template 179 //-------------------------------------------------------------
180 if($('.blog-posts.type-page .fw-page-builder-content').length > 0){ 181 $('.blog-posts.type-page').addClass('multipurpose-pagebuilder'); 182 } 183 184 185 // Inquiry Form 186 //------------------------------------------------------------------------------- 187 $('.show-inquiry-modal').on('click', function () { 188 if ($('.page-template-template-homepage .horizontal-call').length>0) { 189 $('html, body').animate({scrollTop: $('.horizontal-call').offset().top - 200}, 1000); 190 }else if ($('#foocustomlink').length>0) { 191 var link = $('#foocustomlink').attr('data-link'); 192 window.location.href = link; 193 }else{ 194 $('#inquiryModal').modal('show'); 195 } 196 197 return false; 198 }); 199 $('.aw-sc-horizontal form').append($('#cta-button-html').html()); 200 201 if ($('#inquiryModal .wpbs-container').length>0) { 202 $('#inquiryModal').addClass('wpbsm'); 203 } 204 205 206 207 // Attractions Video 208 //------------------------------------------------------------------------------- 209 $('.builder-embed-video').on('click', '.embed-thumb', function(){ 210 var previewImg = $(this), 211 embedContainer = $(this).parent(), 212 videoIframe = embedContainer.find('.video-ifrm iframe'), 213 videoSrc = buildUrl(videoIframe.attr('src'), 'autoplay', '1'); 214 215 videoIframe.load(function(){ 216 previewImg.fadeOut(300, function(){ 217 embedContainer.find('.video-ifrm').css('visibility','visible').hide().fadeIn(300).removeClass('hidden'); 218 }); 219 }).attr('src', videoSrc); 220 221 }); 222 223 224 225 226 // Scroll To Animation 227 //------------------------------------------------------------------------------- 228 $('body').scrollspy({target: '#navigation-top', offset: 88}); 229 230 $('#accommodation-header-menu-1').find('a[href*="#"]:not([href="#"])').click(function () { 231 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 232 var target = $(this.hash); 233 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 234 if (target.length) { 235 $('html,body').animate({ 236 scrollTop: (target.offset().top - 40) 237 }, 1000); 238 if ($('.navbar-toggle').css('display') != 'none') { 239 $(this).parents('.container').find(".navbar-toggle").trigger("click"); 240 } 241 return false; 242 } 243 } 244 }); 245 246 var scrollTo = $(".scroll-to"); 247 248 scrollTo.click(function (event) { 249 $('.modal').modal('hide'); 250 var position = $(document).scrollTop(); 251 var scrollOffset = 150; 252 253 var marker = $(this).attr('href'); 254 $('html, body').animate({scrollTop: $(marker).offset().top - scrollOffset}, 1000); 255 return false; 256 }); 257 258 259 // Scroll Up Btn 260 //------------------------------------------------------------------------------- 261 if ($(window).scrollTop() > 400) { 262 $('body').removeClass("revomenu"); 263 } 264 265 $(window).scroll(function () { 266 if ($(this).scrollTop() > 400) { 267 $('.scroll-up-btn').removeClass("animated fadeOutRight"); 268 $('.scroll-up-btn').fadeIn().addClass("animated fadeInRight"); 269 $('body').removeClass("revomenu"); 270 } else { 271 $('.scroll-up-btn').removeClass("animated fadeInRight"); 272 $('.scroll-up-btn').fadeOut().addClass("animated fadeOutRight"); 273 if ($('#home .rev_slider_wrapper').length>0) { 274 $('body').addClass("revomenu"); 275 } 276 } 277 }); 278 279 $('.scroll-up-btn').click(function () { 280 $('html, body').animate({scrollTop: 0}, 'slow') 281 return false; 282 }); 283 284 $('.scroll-next-btn').click(function () { 285 var toNext = $('.intro-full-screen').height() + 50; 286 $('html, body').animate({scrollTop: toNext}, 'slow') 287 return false; 288 }); 289 290 291 // Slider height/width fix 292 //------------------------------------------------------------- 293 $(window).resize(fullscreenFix); 294 fullscreenFix(); 295 296 297 // Contact Form 298 //------------------------------------------------------------- 299 $("#contactform .wrpr").each(function (i) { 300 $(this).removeClass('form-group'); 301 var wrprInput = $(this).find('.form-control'); 302 var iconKlass = $(this).attr('class').replace("wrpr", "fa "); 303 var inputGroup = wrprInput.parent(); 304 305 inputGroup.addClass('input-group').prepend('<span class="input-group-addon"><i class="'+iconKlass+' fa-fw"></i></span>'); 306 if (wrprInput.is("textarea")){ 307 inputGroup.addClass('textbox'); 308 } 309 $(this).find('.btn-contact-form').append(' <i class="fa fa-angle-right"></i>'); 310 }); 311 312 $("#contactform .caldera-grid").removeClass('caldera-grid'); 313 314 // Newsletter Form 315 //------------------------------------------------------------------------------- 316 $("#newsletter-form").submit(function () { 317 318 var resultDiv = $('#newsletter-form-msg'); 319 var action = $(this).attr('action'); 320 var form = $(this); 321 322 resultDiv.find('.cssload-container').animate({opacity:1},300); 323 324 $.ajax({ 325 url: action, 326 type: 'POST', 327 data: form.serialize(), 328 success: function (data) { 329 data = jQuery.parseJSON(data); 330 if(data.error === 1){ 331 resultDiv.find('.cssload-container').animate({opacity:0}
331,300); 332 resultDiv.find('#newsrdx').html(data.html); 333 }else{ 334 resultDiv.addClass('resulted').html(data.html); 335 } 336 } 337 }); 338 339 return false; 340 }); 341 342 // Preloader 343 //------------------------------------------------------------------------------- 344 345 $(window).load(function () { 346 setTimeout(function () { 347 window.onscroll = function () { 348 }; 349 $('body').removeClass('preloader-overflow'); 350 $('#accommodation-preloader').fadeOut(500); 351 }, 100); 352 353 }); 354 355 356 // Onscroll animation 357 //------------------------------------------------------------- 358 if (typeof accommoSettings.onScroll !== 'undefined') { 359 if ((accommoSettings.onScroll == 'yes') && ($(window).width() > 992)) { 360 new WOW({mobile: false}).init(); 361 } 362 } 363 364 var windowWidth = $(window).width(); 365 366 if (windowWidth < 719) { 367 jQuery('.navbar-collapse a').click(function (e) { 368 jQuery('.navbar-collapse').collapse('toggle'); 369 }); 370 } 371 372 373 374// end document ready 375});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.