1(function () { 2 "use strict"; 3 4 5 6 /* ------------------------------------------------------------------------ 7 LOADER 8 ------------------------------------------------------------------------ */ 9 jQuery(window).load(function() { // makes sure the whole site is loaded 10 jQuery('#loader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website. 11 jQuery('body').delay(350).css({'overflow':'visible'}); 12 }); 13 14 15 16 17 /* ------------------------------------------------------------------------ 18 SMALL HEADER 19 ------------------------------------------------------------------------ */ 20 jQuery(window).scroll(function() { 21 var scroll = jQuery(window).scrollTop(); 22 if (scroll >= 250) { 23 jQuery("body.fixed-header").addClass("smallHeader"); 24 if (scroll >= 350) { 25 jQuery("body.fixed-header").addClass("active"); 26 } 27 } 28 else { 29 jQuery("body.fixed-header").removeClass("smallHeader active"); 30 } 31 }); 32 33 34 35 36 37 /* ------------------------------------------------------------------------ 38 Smooth Scroll 39 ------------------------------------------------------------------------ */ 40 var $window = $(window, '.cd-testimonials-all .cd-testimonials-all-wrapper'); //Window object 41 42 var scrollTime = 0.6; //Scroll time 43 var scrollDistance = 355; //Distance. Use smaller value for shorter scroll and greater value for longer scroll 44 45 $window.on("mousewheel DOMMouseScroll", function(event){ 46 47 event.preventDefault(); 48 49 var delta = event.originalEvent.wheelDelta/125 || -event.originalEvent.detail/3; 50 var scrollTop = $window.scrollTop(); 51 var finalScroll = scrollTop - parseInt(delta*scrollDistance); 52 53 TweenMax.to($window, scrollTime, { 54 scrollTo : { y: finalScroll, autoKill:true }, 55 ease: Power1.easeOut, 56 autoKill: true, 57 overwrite: 5 58 }); 59 60 }); 61 62 63 64 65 66 67 68 69 70 /* ------------------------------------------------------------------------ 71 ITEM COUNTER 72 ------------------------------------------------------------------------ */ 73 var itemcount= 0; 74 75 $('.pluss-item').on("click", function() { 76 itemcount++; 77 $(this).parent().find('.total-items').val(itemcount); 78 }); 79 80 $('.less-item').on("click", function() { 81 itemcount--; 82 $(this).parent().find('.total-items').val(itemcount); 83 }); 84 85 86 87 88 /* ------------------------------------------------------------------------ 89 ADD REVIEW CUSTOM SCRIPT [open/close] 90 ------------------------------------------------------------------------ */ 91 jQuery("#add-review-btn").on("click", function() { 92 jQuery("#add-review-form").slideDown(); 93 }); 94 jQuery("#review-form-close").on("click", function() { 95 jQuery("#add-review-form").slideUp(); 96 }); 97 98 99 100 101 /* ------------------------------------------------------------------------ 102 MOBILE MENU 103 ------------------------------------------------------------------------ */ 104 jQuery(".main-nav li a").on("click", function() { 105 jQuery(this).parent("li").find(".dropdown-menu").slideToggle(); 106 jQuery(this).find("i").toggleClass("fa-caret-down fa-caret-up"); 107 }); 108 jQuery("#review-form-close").on("click", function() { 109 jQuery("#add-review-form").slideUp(); 110 }); 111 112 113 114 115 116 117 /* ------------------------------------------------------------------------ 118 SMOOTH SCROLLING 119 ------------------------------------------------------------------------ */ 120 jQuery('.scroll').each( function() { 121 var $this = jQuery(this), 122 target = this.hash; 123 jQuery(this).on("click", function(e) { 124 e.preventDefault(); 125 if( $this.length > 0 ) { 126 if($this.attr('href') == '#' ) { 127 } else { 128 jQuery('html, body').animate({ 129 scrollTop: (jQuery(target).offset().top) - -1 130 }, 1000); 131 } 132 } 133 }); 134 }); 135 136 137 138 139 /* ------------------------------------------------------------------------ 140 TESTIMONIAL MODEL 141 ------------------------------------------------------------------------ */ 142 $('.cd-see-all').on('click', function(){ 143 $('.cd-testimonials-all').addClass('is-visible'); 144 $('body').css('overflow','hidden'); 145 }); 146 $('.cd-testimonials-all .close-btn').on('click', function(){ 147 $('.cd-testimonials-all').removeClass('is-visible'); 148 $('body').css('overflow-y','scroll'); 149 }); 150 $(document).keyup(function(event){ 151 //check if user has pressed 'Esc' 152 if(event.which=='27'){ 153 $('.cd-testimonials-all').removeClass('is-visible'); 154 } 155 }); 156 $('.cd-testimonials-all-wrapper').children('ul').masonry({ 157 itemSelector: '.cd-testimonials-item' 158 }); 159 160 161 /* SMOOTH SCROLL FOR TESTIMOVIALS WRAPPER */ 162 var $window2 = $('.cd-testimonials-all .cd-testimonials-all-wrapper'); //Window object 163 164 var scrollTime = 0.6; //Scroll time 165 var scrollDistance = 355; //Distance. Use smaller value for shorter scroll and greater value for longer scroll 166 167 $window2.on("mousewheel DOMMouseScroll", function(event){ 168 169 event.preventDefault(); 170 171 var delta = event.originalEvent.wheelDelta/125 || -event.originalEvent.detail/3; 172 var scrollTop = $window2.scrollTop(); 173 var finalScroll = scrollTop - parseInt(delta*scrollDistance); 174 175 TweenMax.to($window2, scrollTime, { 176 scrollTo : { y: finalScroll, autoKill:true }, 177 ease: Power1.easeOut, 178 autoKill: true, 179 overwrite: 5 180 }); 181 182 }); 183 184 185 186 187 /* ------------------------------------------------------------------------ 188 SINGLE ITEM CAROUSEL 189 ------------------------------------------------------------------------ */ 190 jQuery('.single-item-carousel').owlCarousel({ 191 items:1, 192 animateOut: 'fadeOut', 193 navText:[ '', '' ] 194 }) 195 196 197 198 199 /* ------------------------------------------------------------------------ 200 TWO ITEMS CAROUSEL 201 ------------------------------------------------------------------------ */
202 jQuery('.two-items-carousel').owlCarousel({ 203 nav:false, 204 navText:[ '', '' ], 205 responsive:{ 206 0:{ 207 items:1 208 }, 209 768:{ 210 items:1 211 }, 212 979:{ 213 items:2 214 }, 215 1199:{ 216 items:2 217 } 218 219 } 220 }) 221 222 223 224 225 /* ------------------------------------------------------------------------ 226 THREE ITEMS CAROUSEL 227 ------------------------------------------------------------------------ */ 228 jQuery('.three-items-carousel').owlCarousel({ 229 nav:false, 230 navText:[ '', '' ], 231 responsive:{ 232 0:{ 233 items:1 234 }, 235 768:{ 236 items:2 237 }, 238 979:{ 239 items:2 240 }, 241 1199:{ 242 items:3 243 } 244 245 } 246 247 }) 248 249 250 251 252 /* ------------------------------------------------------------------------ 253 FANCYBOX 254 ------------------------------------------------------------------------ */ 255 jQuery('.fancybox').fancybox({ 256 maxWidth : 600, 257 maxHeight : 800, 258 fitToView : false, 259 width : '100%', 260 height : '70%', 261 autoSize : false, 262 autoHeight : true, 263 closeClick : false, 264 openEffect : 'none', 265 closeEffect : 'none' 266 }); 267 268 269 270 271 /* ------------------------------------------------------------------------ 272 FANCYBOX MEDIA 273 ------------------------------------------------------------------------ */ 274 jQuery('.fancybox-media').fancybox({ 275 openEffect : 'none', 276 closeEffect : 'none', 277 helpers : { 278 media : {} 279 } 280 }); 281 282 283 284 285 /* ------------------------------------------------------------------------ 286 PRODUCT DETAIL 287 ------------------------------------------------------------------------ */ 288 jQuery("#product-detail-slider").responsiveSlides({ 289 maxwidth: 1000, 290 timeout: 3E3, 291 pager: true, 292 speed: 700 293 }); 294 295 296 297 298 /* ------------------------------------------------------------------------ 299 VERTICAL TABS 300 ------------------------------------------------------------------------ */ 301 jQuery('.verticalTab').easyResponsiveTabs({ 302 type: 'vertical', 303 width: 'auto', 304 fit: true 305 }); 306 307 308 309 310 /* ------------------------------------------------------------------------ 311 TOGGLES ICON 312 ------------------------------------------------------------------------ */ 313 jQuery('.toggle-heading').on('click', function(){ 314 jQuery(this).find('i').toggleClass('fa-minus fa-plus'); 315 }); 316 317 318 319 320 /* ------------------------------------------------------------------------ 321 SEARCH 322 ------------------------------------------------------------------------ */ 323 jQuery('.search-trigger').on('click', function(){ 324 jQuery('.search-container').fadeIn(); 325 }); 326 jQuery('.header-search-close').on('click', function(){ 327 jQuery('.search-container').fadeOut(); 328 }); 329 330 331 332 333 /* ------------------------------------------------------------------------ 334 ANIMATIONS 335 ------------------------------------------------------------------------ */ 336 jQuery('.animate-it').appear(); 337 jQuery(document.body).on('appear', '.animate-it', function(e, $affected) { 338 var fadeDelayAttr; 339 var fadeDelay; 340 jQuery(this).each(function(){ 341 if (jQuery(this).data("delay")) { 342 fadeDelayAttr = jQuery(this).data("delay") 343 fadeDelay = fadeDelayAttr; 344 } else { 345 fadeDelay = 0; 346 } 347 jQuery(this).delay(fadeDelay).queue(function(){ 348 jQuery(this).addClass('animated').clearQueue(); 349 }); 350 }) 351 }); 352 353 354 355 356 /* ------------------------------------------------------------------------ 357 ISOTOPE 358 ------------------------------------------------------------------------ */ 359 $(window).load(function() { 360 var $container = $('#cases-container'); 361 $container.isotope({ 362 filter: '*', 363 animationOptions: { 364 duration: 750, 365 easing: 'linear', 366 queue: false, 367 } 368 }); 369 370 $('.cases-filter-nav li a').on("click", function() { 371 var selector = $(this).attr('data-filter'); 372 $container.isotope({ 373 filter: selector, 374 animationOptions: { 375 duration: 750, 376 easing: 'linear', 377 queue: false, 378 } 379 }); 380 return false; 381 }); 382 383 var $optionSets = $('.cases-filter-nav'), 384 $optionLinks = $optionSets.find('a'); 385 386 $optionLinks.on("click", function() { 387 var $this = $(this); 388 // don't proceed if already selected 389 if ( $this.hasClass('selected') ) { 390 return false;
391 } 392 var $optionSet = $this.parents('.cases-filter-nav'); 393 $optionSet.find('.selected').removeClass('selected'); 394 $this.addClass('selected'); 395 }); 396 }); 397 398 399 400 401 /* ------------------------------------------------------------------------ 402 RANGE SLIDER [price filter] 403 ------------------------------------------------------------------------ */ 404 jQuery( "#slider-range" ).slider({ 405 range: true, 406 min: 24781, 407 max: 50000, 408 values: [ 28781,45000], 409 410 slide: function( event, ui ) { 411 412 jQuery( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); 413 }, 414 415 stop: function(event, ui) { 416 jQuery( "#sort_price_max" ).val(ui.values[ 1 ] ); 417 jQuery( "#sort_price_min" ).val(ui.values[ 0 ] ); 418 } 419 }); 420 jQuery( "#amount" ).val( "$" + jQuery( "#slider-range" ).slider( "values", 0 ) + 421 " - $" + jQuery( "#slider-range" ).slider( "values", 1 ) ); 422 423})(jQuery); 424 425 426 427 428 /* ------------------------------------------------------------------------ 429 FORMS 430 ------------------------------------------------------------------------ */ 431 432 function checkcontact(input) 433 { 434 var pattern1=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; 435 if(pattern1.test(input)) 436 { 437 return true; 438 } 439 else{ 440 return false; 441 } 442 } 443 444 445 function validateSubscription(){ 446 447 448 var footer_name = document.getElementById("subscribe_name"); 449 var footer_email_address = document.getElementById("subscribe_email"); 450 451 if(footer_name.value == ""){ 452 footer_name.className = "input error"; 453 return false; 454 } 455 else if(footer_email_address.value == ""){ 456 footer_email_address.className = "input error"; 457 return false; 458 } 459 else if(checkcontact(footer_email_address.value) == false){ 460 footer_email_address.className = "input error"; 461 return false; 462 } 463 else{ 464 465 $.ajax({ 466 type: "POST", 467 url: 'process.php', 468 data: $("#subscribe_form").serialize(), 469 success: function(msg) 470 { 471 if(msg == 'success') 472 { 473 footer_name.className = "input"; 474 footer_name.value = ""; 475 footer_email_address.className = "input"; 476 footer_email_address.value = ""; 477 478 $("#subscribe_form").hide(); 479 document.getElementById("subscribe_success").style.display = "block"; 480 document.getElementById("subscribe_success").innerHTML = "Thank You! We'll contact you shortly."; 481 }else{ 482 document.getElementById("subscribe_error").style.display = "block"; 483 document.getElementById("subscribe_error").innerHTML = "Oops! Something went wrong while proceeding."; 484 } 485 } 486 487 }); 488 489 } 490 } 491 492 function removeChecks(){ 493 var footer_name = document.getElementById("subscribe_name"); 494 var footer_email_address = document.getElementById("subscribe_email"); 495 496 if(footer_name.value != ""){ 497 footer_name.className = "input"; 498 } 499 if(footer_email_address.value != "" && checkcontact(footer_email_address.value) == true){ 500 footer_email_address.className = "input"; 501 } 502 503 } 504 505 506 function validateContact(){ 507 var errors = ""; 508 509 var contact_name = document.getElementById("contact_name"); 510 var contact_email_address = document.getElementById("contact_email"); 511 var contact_phone = document.getElementById("contact_phone"); 512 513 if(contact_name.value == ""){ 514 errors+= 'Please provide your name.'; 515 } 516 else if(contact_email_address.value == ""){ 517 errors+= 'Please provide an email address.'; 518 } 519 else if(checkcontact(contact_email_address.value) == false){ 520 errors+= 'Please provide a valid email address.'; 521 } 522 else if(contact_phone.value == ""){ 523 errors+= 'Please provide a Phone No.'; 524 } 525 526 527 if(errors) 528 { 529 document.getElementById("error").style.display = "block"; 530 document.getElementById("error").innerHTML = errors; 531 return false; 532 } 533 534 else{ 535 536 $.ajax({ 537 type: "POST", 538 url: 'process.php', 539 data: $("#contact_form").serialize(), 540 success: function(msg) 541 { 542 if(msg == 'success') 543 { 544 document.getElementById("error").style.display = "none"; 545 document.getElementById("contact_name").value = ""; 546 document.getElementById("contact_email").value = ""; 547 document.getElementById("contact_phone").value = ""; 548 document.getElementById("message").value = ""; 549 $("#contact_form").hide(); 550 document.getElementById("success").style.display = "block"; 551 document.getElementById("success").innerHTML = "Thank You! We'll contact you shortly."; 552 }else{ 553 document.getElementById("error").style.display = "block"; 554 document.getElementById("error").innerHTML = "Oops! Something went wrong while proceeding."; 555 } 556 } 557 558 }); 559 560 } 561 }
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.