1(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 10 11 // Parallax Scrolling 12 //------------------------------------------------------------- 13 var $w = $(window); 14 var newsletterSimple = $('.newsletter-simple'); 15 var productInfo = $('.product-info'); 16 17 function move($c) { 18 var offset = $c.offset().top; 19 var scroll = $w.scrollTop(); 20 var diff = offset - scroll; 21 var pos = 'center ' + (-diff)*0.2 + 'px'; 22 $c.css({'backgroundPosition':pos}); 23 } 24 $w.bind('scroll', function(e){ 25 //move(newsletterSimple); 26 //move(productInfo); 27 }); 28 29 30 31 32 // Initialize Tooltip 33 //------------------------------------------------------------- 34 $('.my-tooltip').tooltip(); 35 36 37 // Initialize Datetimepicker 38 //------------------------------------------------------------------------------- 39 $('.datepicker').datepicker({ 40 datesDisabled: ['07/21/2015', '07/22/2015', '07/23/2015'] 41 }).on('changeDate', function () { 42 $(this).datepicker('hide'); 43 }); 44 45 46 // Show Appointment Modal 47 //------------------------------------------------------------------------------- 48 $('.show-appointment-modal').on('click', function () { 49 var service = $(this).data('service'); 50 if (service) { 51 $("#appointment-service").val(service); 52 } 53 $('#appointmentModal').modal('show'); 54 return false; 55 }); 56 57 58 // Scroll To Animation 59 //------------------------------------------------------------------------------- 60 $('body').scrollspy({target: '#navigation-top-1', offset: 88}); 61 62 var scrollTo = $(".scroll-to"); 63 64 scrollTo.click(function (event) { 65 $('.modal').modal('hide'); 66 var position = $(document).scrollTop(); 67 var scrollOffset = 87; 68 69 var marker = $(this).attr('href'); 70 if ( window.location.pathname !== '/' ) { 71 window.localStorage['marker'] = marker; 72 window.location.href = window.location.origin; 73 } 74 $('html, body').animate({scrollTop: $(marker).offset().top - scrollOffset}, 'slow'); 75 return false; 76 }); 77 78 $(window).load(function() { 79 if(window.localStorage['marker']) { 80 $('html, body').animate({scrollTop: $(window.localStorage['marker']).offset().top - 87}, 'slow'); 81 localStorage.removeItem('marker'); 82 } 83 }); 84 85 86 // Scroll Up Btn 87 //------------------------------------------------------------------------------- 88 $(window).scroll(function(){ 89 if ($(this).scrollTop() > 100) { 90 $('.scroll-up-btn').removeClass("animated fadeOutRight"); 91 $('.scroll-up-btn').fadeIn().addClass("animated fadeInRight"); 92 } else { 93 $('.scroll-up-btn').removeClass("animated fadeInRight"); 94 $('.scroll-up-btn').fadeOut().addClass("animated fadeOutRight"); 95 } 96 }); 97 98 99 100 // Navigation Top 101 //------------------------------------------------------------- 102 $(document).scroll(function () { 103 var y = $(this).scrollTop(); 104 if (y > 300) { 105 $('.navbar-hidden').fadeIn(); 106 } else { 107 $('.navbar-hidden').fadeOut(); 108 } 109 }); 110 111 112 113 114 /* fix vertical when not overflow 115 call fullscreenFix() if .fullscreen content changes */ 116 function fullscreenFix() { 117 var h = $('body').height(); 118 // set .fullscreen height 119 $(".content-b").each(function (i) { 120 if ($(this).innerHeight() <= h) { 121 $(this).closest(".fullscreen").addClass("not-overflow"); 122 } 123 }); 124 } 125 126 $(window).resize(fullscreenFix); 127 fullscreenFix(); 128 129 130 /* resize background images */ 131 function backgroundResize() { 132 var windowH = $(window).height(); 133 $(".header-full-screen-img").each(function (i) { 134 var path = $(this); 135 // variables 136 var contW = path.width(); 137 var contH = path.height(); 138 var imgW = path.attr("data-img-width"); 139 var imgH = path.attr("data-img-height"); 140 var ratio = imgW / imgH; 141 // overflowing difference 142 var diff = parseFloat(path.attr("data-diff")); 143 diff = diff ? diff : 0; 144 // remaining height to have fullscreen image only on parallax
145 var remainingH = 0; 146 if (path.hasClass("parallax")) { 147 var maxH = contH > windowH ? contH : windowH; 148 remainingH = windowH - contH; 149 } 150 // set img values depending on cont 151 imgH = contH + remainingH + diff; 152 imgW = imgH * ratio; 153 // fix when too large 154 if (contW > imgW) { 155 imgW = contW; 156 imgH = imgW / ratio; 157 } 158 // 159 path.data("resized-imgW", imgW); 160 path.data("resized-imgH", imgH); 161 path.css("background-size", imgW + "px " + imgH + "px"); 162 }); 163 } 164 165 $(window).resize(backgroundResize); 166 $(window).focus(backgroundResize); 167 backgroundResize(); 168 169 // Appointment Form 170 //------------------------------------------------------------- 171 172 $("#appointment-form").submit(function () { 173 174 $('#appointment-form-msg').addClass('hidden'); 175 $('#appointment-form-msg').removeClass('alert-success'); 176 $('#appointment-form-msg').removeClass('alert-danger'); 177 178 $('#appointment-form .btn-submit').attr('disabled', 'disabled'); 179 180 $.ajax({ 181 type: "POST", 182 url: "php/index.php", 183 data: $("#appointment-form").serialize(), 184 dataType: "json", 185 success: function (data) { 186 187 if ('success' == data.result) { 188 $('#appointment-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-success'); 189 $('#appointment-form-msg').html(data.msg[0]); 190 $('#appointment-form .btn-submit').removeAttr('disabled'); 191 $('#appointment-form')[0].reset(); 192 } 193 194 if ('error' == data.result) { 195 $('#appointment-form-msg').css('visibility', 'visible').hide().fadeIn().removeClass('hidden').addClass('alert-danger'); 196 $('#appointment-form-msg').html(data.msg[0]); 197 $('#appointment-form .btn-submit').removeAttr('disabled'); 198 } 199 200 } 201 }); 202 203 return false; 204 }); 205 206 207 // Newsletter Form 208 //------------------------------------------------------------------------------- 209 210 $( "#newsletter-form" ).submit(function() { 211 212 $('#newsletter-form-msg').addClass('hidden'); 213 $('#newsletter-form-msg').removeClass('alert-success'); 214 $('#newsletter-form-msg').removeClass('alert-danger'); 215 216 $('#newsletter-form input[type=submit]').attr('disabled', 'disabled'); 217 218 $.ajax({ 219 type: "POST", 220 url: "php/index.php", 221 data: $("#newsletter-form").serialize(), 222 dataType: "json", 223 success: function(data) { 224 225 if('success' == data.result) 226 { 227 $('#newsletter-form-msg').css('visibility','visible').hide().fadeIn().removeClass('hidden').addClass('alert-success'); 228 $('#newsletter-form-msg').html(data.msg[0]); 229 $('#newsletter-form input[type=submit]').removeAttr('disabled'); 230 $('#newsletter-form')[0].reset(); 231 } 232 233 if('error' == data.result) 234 { 235 $('#newsletter-form-msg').css('visibility','visible').hide().fadeIn().removeClass('hidden').addClass('alert-danger'); 236 $('#newsletter-form-msg').html(data.msg); 237 $('#newsletter-form input[type=submit]').removeAttr('disabled'); 238 } 239 240 } 241 }); 242 243 return false; 244 }); 245 246 247// end document ready 248})(jQuery);
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.