1jQuery( document ).ready( function ( $ ) { 2 3 "use strict"; 4 5 // Config 6 //------------------------------------------------------------------------------- 7 var companyName = 'Spa and Wellness Center'; 8 var address = '3861 Sepulveda Blvd., Culver City, CA 90230'; // Enter your Address 9 if ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent ) ) { 10 $.support.transition = false; 11 } 12 13 14 function loadImage( src, f ) { 15 var img = new Image(); 16 17 $( img ).load( function () { 18 $( this ).hide(); 19 if ( f ) 20 f( img ); 21 } ).error( function () { 22 return false; 23 } ).attr( 'src', src ); 24 } 25 26 //------------------------------------------------------------- 27 // Fixes inrto height 28 //------------------------------------------------------------- 29 30 var windowWidth = $( window ).width(); 31 32 function fixIntroHeight( H ) { 33 var intro = $( '.intro-full-screen' ); 34 var onepage = $( '.onepage-home' ); 35 if ( intro.find( '.carousel' ).length > 0 ) { 36 intro.addClass( 'intro-slider-top-fix' ); 37 } 38 if ( onepage.find( '.rev_slider' ).length > 0 ) { 39 intro.addClass( 'rev-slider-fix' ); 40 $( '.scroll-down' ).hide(); 41 onepage.removeClass( 'intro-full-screen' ); 42 onepage.css( 'margin', 0 ); 43 } else { 44 intro.css( { height: H } ); 45 } 46 47 //If you dont want to use Auto height change H to '650px' 48 49 $( '.intro-full-screen' ).find( '.carousel' ).css( { height: H } ); 50 } 51 if ( windowWidth > 1000 ) { 52 var H = $( window ).height(); 53 54 fixIntroHeight( H ); 55 56 $( window ).resize( function () { 57 H = $( window ).height(); 58 fixIntroHeight( H ); 59 } ); 60 61 } 62 // Fixing full width divider 63 //------------------------------------------------------------- 64 $( '.fw-divider-full-width' ).closest( 'section' ).addClass( 'divider-section' ); 65 66 67 // Fixing call-to-action 68 //------------------------------------------------------------- 69 $( '.fw-call-to-action' ).closest( 'section' ).addClass( 'call-to-action' ); 70 71 // Fixing review 72 //------------------------------------------------------------- 73 $( '.review-slider' ).parents( 'section.no-spacing' ).find( '.fw-container-fluid' ).addClass( 'no-padding' ); 74 75 76 // Modal Scrolling Fixes on iOS 77 //------------------------------------------------------------- 78 if ( navigator.userAgent.match( /iPhone|iPad|iPod/i ) ) { 79 var styleEl = document.createElement( 'style' ), styleSheet; 80 document.head.appendChild( styleEl ); 81 styleSheet = styleEl.sheet; 82 styleSheet.insertRule( ".modal, body .booked-modal { position:absolute; bottom:auto; background-color:transparent;}", 0 ); 83 84 } 85 86 // Preloader 87 //------------------------------------------------------------------------------- 88 89 $( window ).load( function () { 90 setTimeout( function () { 91 window.onscroll = function () { 92 }; 93 $( '#page-preloader' ).addClass( 'slideOutUp' ); 94 95 // Fix for IE 9 96 setTimeout( function () { 97 $( '#page-preloader' ).addClass( 'hidden' ); 98 }, 700 ); 99 100 }, 100 ); 101 102 } ); 103 104 105 // pagination fixing 106 //------------------------------------------------------------- 107 $( '.pagination li' ).find( '.current' ).parent().addClass( 'active' ); 108 $( '#menu-testing-menu' ).find( '.active' ).removeClass( 'active' ); 109 110 111 // Initialize Tooltip 112 //------------------------------------------------------------- 113 $( '.my-tooltip' ).tooltip(); 114 115 116 // Fixing header logo padding 117 //------------------------------------------------------------- 118 loadImage( $( '.nav-logo img' ).attr( 'src' ), function ( image ) { 119 if ( image.naturalHeight < 54 ) { 120 var paddingTop = ( 54 - image.naturalHeight ) / 2; 121 $( '.nav-logo' ).css( { 'padding-top': paddingTop } ); 122 } 123 } ); 124 125 126 // Initialize Datetimepicker 127 //------------------------------------------------------------------------------- 128 $( '.datepicker' ).datepicker().on( 'changeDate', function () { 129 $( this ).datepicker( 'hide' ); 130 } ); 131 132 133 // Show Appointment Modal 134 //------------------------------------------------------------------------------- 135 $( '.show-appointment-modal' ).on( 'click', function () { 136 var service = $( this ).data( 'service' ); 137 if ( service ) { 138 $( "#appointment-service" ).val( service ); 139 } 140 $( '#appointmentModal' ).modal( 'show' ); 141 return false;
142 } ); 143 144 145 // Scroll To Animation 146 //------------------------------------------------------------------------------- 147 $( 'body' ).scrollspy( { target: '#navigation-top', offset: 88 } ); 148 149 $( '#bs-navbar-collapse-1' ).find( 'a[href*="#"]:not([href="#"])' ).click( function () { 150 if ( location.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && location.hostname == this.hostname ) { 151 var target = $( this.hash ); 152 target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' ); 153 if ( target.length ) { 154 $( 'html,body' ).animate( { 155 scrollTop: ( target.offset().top - 80 ) 156 }, 1000 ); 157 if ( $( '.navbar-toggle' ).css( 'display' ) != 'none' ) { 158 $( this ).parents( '.container' ).find( ".navbar-toggle" ).trigger( "click" ); 159 } 160 return false; 161 } 162 } 163 } ); 164 165 var scrollTo = $( ".scroll-to" ); 166 167 scrollTo.click( function ( event ) { 168 $( '.modal' ).modal( 'hide' ); 169 var position = $( document ).scrollTop(); 170 var scrollOffset = 87; 171 172 var marker = $( this ).attr( 'href' ); 173 $( 'html, body' ).animate( { scrollTop: $( marker ).offset().top - scrollOffset }, 1000 ); 174 return false; 175 } ); 176 177 178 179// Mega Menu 180 //------------------------------------------------------------- 181 function megaMenuXs() { 182 var winW = jQuery( window ).width(); 183 jQuery( '.mega-menu-activated .mega-menu' ).each( function ( a, b ) { 184 var o = jQuery( this ).offset(), 185 r = jQuery( this ).css( 'right' ); 186 187 if ( o.left < 0 ) { 188 r = parseInt( r ) + o.left - 15; 189 jQuery( this ).css( { right: r } ); 190 } 191 } ); 192 193 if ( winW < 992 ) { 194 195 jQuery( '.mega-menu-activated .navbar-nav>.menu-item-has-children>a' ).click( function ( e ) { 196 jQuery( this ).parent().find( '.sub-menu, .mega-menu' ).toggleClass( 'open' ); 197 return false; 198 } ); 199 200 jQuery( 'body:not(.mega-menu-activated .navbar-nav a)' ).click( function ( e ) { 201 jQuery( '.mega-menu-activated .navbar-nav .open' ).removeClass( 'open' ); 202 } ); 203 204 } 205 } 206 207 var resizeId; 208 jQuery( window ).resize( function () { 209 clearTimeout( resizeId ); 210 resizeId = setTimeout( megaMenuXs, 500 ); 211 } ); 212 megaMenuXs(); 213 214 215 jQuery( '.hidden.cross-fire' ).remove(); 216 jQuery( '#menu-main-menu' ).find( '.menu-item' ).removeClass( 'current-menu-item' ); 217 218 219 220 221 222 223 // Scroll Up Btn 224 //------------------------------------------------------------------------------- 225 $( window ).scroll( function () { 226 if ( $( this ).scrollTop() > 100 ) { 227 $( '.scroll-up-btn' ).removeClass( "animated fadeOutRight" ); 228 $( '.scroll-up-btn' ).fadeIn().addClass( "animated fadeInRight" ); 229 } else { 230 $( '.scroll-up-btn' ).removeClass( "animated fadeInRight" ); 231 $( '.scroll-up-btn' ).fadeOut().addClass( "animated fadeOutRight" ); 232 } 233 } ); 234 235 $( '.scroll-up-btn' ).click( function () { 236 $( 'html, body' ).animate( { scrollTop: 0 }, 'slow' ) 237 return false; 238 } ); 239 240 $( '.scroll-next-btn' ).click( function () { 241 var toNext = $( '.intro-full-screen' ).height() + 50; 242 $( 'html, body' ).animate( { scrollTop: toNext }, 'slow' ) 243 return false; 244 } ); 245 246 // Navigation Top 247 //------------------------------------------------------------- 248 $( document ).scroll( function () { 249 var y = $( this ).scrollTop(); 250 if ( y > 300 ) { 251 $( '.navbar-hidden' ).fadeIn(); 252 } else { 253 $( '.navbar-hidden' ).fadeOut(); 254 } 255 } ); 256 257 258 // Gallery 259 //------------------------------------------------------------- 260 $( ".fancybox" ).fancybox( { 261 maxWidth: 800, 262 maxHeight: 600, 263 fitToView: true, 264 width: '70%', 265 height: '70%', 266 autoSize: true, 267 closeClick: true, 268 openEffect: 'none', 269 closeEffect: 'none' 270 } ); 271 272 273 /* fix vertical when not overflow 274 call fullscreenFix() if .fullscreen content changes */ 275 function fullscreenFix() { 276 var h = $( 'body' ).height(); 277 // set .fullscreen height 278 $( ".content-b" ).each( function ( i ) { 279 if ( $( this ).innerHeight() <= h ) { 280 $( this ).closest( ".fullscreen" ).addClass( "not-overflow" ); 281 } 282 } ); 283 } 284 285 $( window ).resize( fullscreenFix ); 286 fullscreenFix(); 287 288 289 290 // Appointment Form 291 //------------------------------------------------------------- 292 $( ".visual-form-builder" ).submit( function () { 293 294 var action = $( this ).attr( 'action' ); 295 var form = $( this ); 296 var successText = $( '#xs_form_success' ).html(); 297 298 if ( form.valid() == true ) { 299 form.find( '.vfb-submit' ).val( 'wait..' ); 300 $.ajax( { 301 type: "POST", 302 url: action, 303 data: form.serialize(), 304 success: function ( data ) { 305 $( '#appointmentModal' ).find( '.modal-body' ).html( successText ); 306 } 307 } ); 308 309 return false;
310 } 311 } ); 312 313 314 // Newsletter Form 315 //------------------------------------------------------------------------------- 316 317 $( "#newsletter-form" ).submit( function () { 318 319 var resultDiv = $( '#newsletter-form-msg' ); 320 var action = $( this ).attr( 'action' ); 321 var form = $( this ); 322 323 resultDiv.html( ' ' ).hide(); 324 325 $.ajax( { 326 url: action, 327 type: 'POST', 328 data: form.serialize(), 329 success: function ( data ) { 330 resultDiv.html( data ).show(); 331 } 332 } ); 333 334 return false; 335 } ); 336 337 338 339 // Load Contact Gmap 340 //------------------------------------------------------------- 341 if ( typeof wellnessSettings.onScroll !== 'undefined' ) { 342 if ( ( wellnessSettings.onScroll == 'yes' ) && ( $( window ).width() > 992 ) ) { 343 new WOW( { mobile: false } ).init(); 344 } 345 } 346 347// $('#submit-request-appointment').click(function () { 348// alert('bhh'); 349// }); 350 351 /* ========================================================================== 352 Contact Form 353 ========================================================================== */ 354 355 fwForm.initAjaxSubmit( { 356 //selector: 'form[some-custom-attribute].or-some-class' 357 selector: 'form[data-fw-form-id="fw_form"]', 358 ajaxUrl: adminAjax 359 } ); 360 361 362//Multi step menu 363 364 $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { 365 // Avoid following the href location when clicking 366 event.preventDefault(); 367 // Avoid having the menu to close when clicking 368 event.stopPropagation(); 369 // If a menu is already open we close it 370 //$('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open'); 371 // opening the one you clicked on 372 $(this).parent().addClass('open'); 373 374 var menu = $(this).parent().find("ul"); 375 var menupos = menu.offset(); 376 377 if ((menupos.left + menu.width()) + 30 > $(window).width()) { 378 var newpos = - menu.width(); 379 } else { 380 var newpos = $(this).parent().width(); 381 } 382 menu.css({ left:newpos }); 383 384}); 385 386 387 388 389// end document ready 390} ); 391 392 393 394// Fixing booking plugin 395//------------------------------------------------------------- 396jQuery( document ).on( "booked-on-requested-appointment", function ( e, p ) { 397 if ( typeof profilePage !== 'undefined' && profilePage ) { 398 } else { 399 ( function ( $ ) { 400 var successText = $( '#xs_form_success' ).html(); 401 $( '#appointmentModal' ).find( '.modal-body' ).html( successText ); 402 } )( jQuery ); 403 } 404 close_booked_modal(); 405} ); 406 407var org_create_booked_modal = window.create_booked_modal; 408window.create_booked_modal = function () { 409 jQuery( 'body' ).addClass( 'new-appt-opened' ); 410 org_create_booked_modal(); 411}; 412 413var org_close_booked_modal = window.close_booked_modal; 414window.close_booked_modal = function () { 415 jQuery( 'body' ).removeClass( 'new-appt-opened' ); 416 org_close_booked_modal(); 417}; 418 419var org_adjust_calendar_boxes = window.adjust_calendar_boxes; 420window.adjust_calendar_boxes = function () { 421 org_adjust_calendar_boxes(); 422}; 423 424 425 426
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.