1/* Theme Name:iDea - Clean & Powerful Bootstrap Theme 2 * Author:HtmlCoder 3 * Author URI:http://www.htmlcoder.me 4 * Author e-mail:[email protected] 5 * Version:1.0.0 6 * Created:October 2014 7 * License URI:http://wrapbootstrap.com 8 * File Description: Initializations of plugins 9 */ 10 11(function($){ 12 $(document).ready(function(){ 13 14 //Show dropdown on hover only for desktop devices 15 //----------------------------------------------- 16 var delay=0, setTimeoutConst; 17 if (Modernizr.mq('only all and (min-width: 768px)') && !Modernizr.touch) { 18 $('.main-navigation .navbar-nav>li.dropdown, .main-navigation li.dropdown>ul>li.dropdown').hover( 19 function(){ 20 var $this = $(this); 21 setTimeoutConst = setTimeout(function(){ 22 $this.addClass('open').slideDown(); 23 $this.find('.dropdown-toggle').addClass('disabled'); 24 }, delay); 25 26 }, function(){ 27 clearTimeout(setTimeoutConst ); 28 $(this).removeClass('open'); 29 $(this).find('.dropdown-toggle').removeClass('disabled'); 30 }); 31 }; 32 33 //Show dropdown on click only for mobile devices 34 //----------------------------------------------- 35 if (Modernizr.mq('only all and (max-width: 767px)') || Modernizr.touch) { 36 $('.main-navigation [data-toggle=dropdown], .header-top [data-toggle=dropdown]').on('click', function(event) { 37 // Avoid following the href location when clicking 38 event.preventDefault(); 39 // Avoid having the menu to close when clicking 40 event.stopPropagation(); 41 // close all the siblings 42 $(this).parent().siblings().removeClass('open'); 43 // close all the submenus of siblings 44 $(this).parent().siblings().find('[data-toggle=dropdown]').parent().removeClass('open'); 45 // opening the one you clicked on 46 $(this).parent().toggleClass('open'); 47 }); 48 }; 49 50 //Main slider 51 //----------------------------------------------- 52 53 //Revolution Slider 54 if ($(".slider-banner-container").length>0) { 55 56 $(".tp-bannertimer").show(); 57 58 $('.slider-banner-container .slider-banner').show().revolution({ 59 delay:10000, 60 startwidth:1140, 61 startheight:520, 62 63 navigationArrows:"solo", 64 65 navigationStyle: "round", 66 navigationHAlign:"center", 67 navigationVAlign:"bottom", 68 navigationHOffset:0, 69 navigationVOffset:20, 70 71 soloArrowLeftHalign:"left", 72 soloArrowLeftValign:"center", 73 soloArrowLeftHOffset:20, 74 soloArrowLeftVOffset:0, 75 76 soloArrowRightHalign:"right", 77 soloArrowRightValign:"center", 78 soloArrowRightHOffset:20, 79 soloArrowRightVOffset:0, 80 81 fullWidth:"on", 82 83 spinner:"spinner0", 84 85 stopLoop:"off", 86 stopAfterLoops:-1, 87 stopAtSlide:-1, 88 onHoverStop: "off", 89 90 shuffle:"off", 91 92 autoHeight:"off", 93 forceFullWidth:"off", 94 95 hideThumbsOnMobile:"off", 96 hideNavDelayOnMobile:1500, 97 hideBulletsOnMobile:"off", 98 hideArrowsOnMobile:"off", 99 hideThumbsUnderResolution:0, 100 101 hideSliderAtLimit:0, 102 hideCaptionAtLimit:0, 103 hideAllCaptionAtLilmit:0, 104 startWithSlide:0 105 }); 106 107 $('.slider-banner-container .slider-banner-2').show().revolution({ 108 delay:10000, 109 startwidth:1140, 110 startheight:520, 111 112 navigationArrows:"solo", 113 114 navigationStyle: "preview4", 115 navigationHAlign:"center", 116 navigationVAlign:"bottom", 117 navigationHOffset:0, 118 navigationVOffset:20, 119 120 soloArrowLeftHalign:"left", 121 soloArrowLeftValign:"center", 122 soloArrowLeftHOffset:20, 123 soloArrowLeftVOffset:0, 124 125 soloArrowRightHalign:"right", 126 soloArrowRightValign:"center", 127 soloArrowRightHOffset:20, 128 soloArrowRightVOffset:0, 129 130 fullWidth:"on", 131 132 spinner:"spinner0", 133 134 stopLoop:"off", 135 stopAfterLoops:-1, 136 stopAtSlide:-1, 137 onHoverStop: "off", 138 139 shuffle:"off", 140 141 autoHeight:"off", 142 forceFullWidth:"off", 143 144 hideThumbsOnMobile:"off", 145 hideNavDelayOnMobile:1500, 146 hideBulletsOnMobile:"off", 147 hideArrowsOnMobile:"off", 148 hideThumbsUnderResolution:0, 149 150 hideSliderAtLimit:0, 151 hideCaptionAtLimit:0, 152 hideAllCaptionAtLilmit:0, 153 startWithSlide:0 154 }); 155 156 $('.slider-banner-container .slider-banner-3').show().revolution({ 157 delay:10000, 158 startwidth:1140, 159 startheight:520, 160 dottedOverlay: "twoxtwo", 161 162 parallax:"mouse", 163 parallaxBgFreeze:"on", 164 parallaxLevels:[3,2,1], 165 166 navigationArrows:"solo", 167 168 navigationStyle: "preview5", 169 navigationHAlign:"center", 170 navigationVAlign:"bottom", 171 navigationHOffset:0, 172 navigationVOffset:20, 173 174 soloArrowLeftHalign:"left", 175 soloArrowLeftValign:"center", 176 soloArrowLeftHOffset:20, 177 soloArrowLeftVOffset:0, 178 179 soloArrowRightHalign:"right", 180 soloArrowRightValign:"center", 181 soloArrowRightHOffset:20, 182 soloArrowRightVOffset:0, 183 184 fullWidth:"on", 185 186 spinner:"spinner0", 187 188 stopLoop:"off", 189 stopAfterLoops:-1, 190 stopAtSlide:-1, 191 onHoverStop: "off", 192 193 shuffle:"off", 194 195 autoHeight:"off", 196 forceFullWidth:"off", 197 198 hideThumbsOnMobile:"off", 199 hideNavDelayOnMobile:1500, 200 hideBulletsOnMobile:"off", 201 hideArrowsOnMobile:"off", 202 hideThumbsUnderResolution:0, 203 204 hideSliderAtLimit:0, 205 hideCaptionAtLimit:0, 206 hideAllCaptionAtLilmit:0, 207 startWithSlide:0 208 }); 209 210 $('.slider-banner-container .slider-banner-fullscreen').show().revolution({ 211 delay:10000, 212 startwidth:1140, 213 startheight:520, 214 fullWidth:"off", 215 fullScreen:"on", 216 fullScreenOffsetContainer: "", 217 fullScreenOffset: "82px", 218 219 navigationArrows:"solo", 220 221 navigationStyle: "preview4", 222 navigationHAlign:"center", 223 navigationVAlign:"bottom", 224 navigationHOffset:0, 225 navigationVOffset:20, 226 227 soloArrowLeftHalign:"left", 228 soloArrowLeftValign:"center", 229 soloArrowLeftHOffset:20, 230 soloArrowLeftVOffset:0, 231 232 soloArrowRightHalign:"right", 233 soloArrowRightValign:"center", 234 soloArrowRightHOffset:20, 235 soloArrowRightVOffset:0, 236 237 spinner:"spinner4", 238 239 stopLoop:"off", 240 stopAfterLoops:-1, 241 stopAtSlide:-1, 242 onHoverStop: "off", 243 244 shuffle:"off", 245 hideTimerBar:"on", 246 247 autoHeight:"off", 248 forceFullWidth:"off", 249 250 hideThumbsOnMobile:"off", 251 hideNavDelayOnMobile:1500, 252 hideBulletsOnMobile:"off", 253 hideArrowsOnMobile:"off", 254 hideThumbsUnderResolution:0, 255 256 hideSliderAtLimit:0, 257 hideCaptionAtLimit:0, 258 hideAllCaptionAtLilmit:0, 259 startWithSlide:0 260 }); 261 262 }; 263 264 //Owl carousel 265 //----------------------------------------------- 266 if ($('.owl-carousel').length > 0) { 267 268 $(".owl-carousel.carousel").owlCarousel({ 269 items: 4, 270 pagination: false, 271 navigation: true, 272 navigationText: false 273 }); 274 275 $(".owl-carousel.carousel-autoplay").owlCarousel({ 276 items: 4, 277 autoPlay: 5000, 278 pagination: false, 279 navigation: true, 280 navigationText: false 281 }); 282 283 $(".owl-carousel.clients").owlCarousel({ 284 items: 4, 285 autoPlay: true, 286 pagination: false, 287 itemsDesktopSmall: [992,5], 288 itemsTablet: [768,4], 289 itemsMobile: [479,3] 290 }); 291 $(".owl-carousel.content-slider").owlCarousel({ 292 singleItem: true, 293 autoPlay: 5000, 294 navigation: false, 295 navigationText: false, 296 pagination: false 297 }); 298 $(".owl-carousel.content-slider-with-controls").owlCarousel({ 299 singleItem: true,
300 autoPlay: false, 301 navigation: true, 302 navigationText: false, 303 pagination: true, 304 afterInit: function() { centerOverlayContainer(); }, 305 afterAction: function() { centerOverlayContainer(); } 306 }); 307 $(".owl-carousel.content-slider-with-controls-autoplay").owlCarousel({ 308 singleItem: true, 309 autoPlay: 5000, 310 navigation: true, 311 navigationText: false, 312 pagination: true 313 }); 314 $(".owl-carousel.content-slider-with-controls-bottom").owlCarousel({ 315 singleItem: true, 316 autoPlay: false, 317 navigation: true, 318 navigationText: false, 319 pagination: true 320 }); 321 }; 322 323 // Animations 324 //----------------------------------------------- 325 if (($("[data-animation-effect]").length>0) && !Modernizr.touch) { 326 $("[data-animation-effect]").each(function() { 327 var $this = $(this), 328 animationEffect = $this.attr("data-animation-effect"); 329 if(Modernizr.mq('only all and (min-width: 768px)') && Modernizr.csstransitions) { 330 $this.appear(function() { 331 var delay = ($this.attr("data-effect-delay") ? $this.attr("data-effect-delay") : 1); 332 if(delay > 1) $this.css("effect-delay", delay + "ms"); 333 setTimeout(function() { 334 $this.addClass('animated object-visible ' + animationEffect); 335 }, delay); 336 }, {accX: 0, accY: -130}); 337 } else { 338 $this.addClass('object-visible'); 339 } 340 }); 341 }; 342 343 // Stats Count To 344 //----------------------------------------------- 345 if ($(".stats [data-to]").length>0) { 346 $(".stats [data-to]").each(function() { 347 var $this = $(this), 348 offset = $this.offset().top; 349 if($(window).scrollTop() > (offset - 800) && !($this.hasClass('counting'))) { 350 $this.addClass('counting'); 351 $this.countTo(); 352 }; 353 $(window).scroll(function() { 354 if($(window).scrollTop() > (offset - 800) && !($this.hasClass('counting'))) { 355 $this.addClass('counting'); 356 $this.countTo(); 357 } 358 }); 359 }); 360 }; 361 362 // Isotope filters 363 //----------------------------------------------- 364 if ($('.isotope-container').length>0 || $('.masonry-grid').length>0 || $('.masonry-grid-fitrows').length>0) { 365 $(window).ready(function() { 366 $('.masonry-grid').isotope({ 367 itemSelector: '.masonry-grid-item', 368 layoutMode: 'masonry' 369 }); 370 $('.masonry-grid-fitrows').isotope({ 371 itemSelector: '.masonry-grid-item', 372 layoutMode: 'fitRows' 373 }); 374 $('.isotope-container').fadeIn(); 375 var $container = $('.isotope-container').isotope({ 376 itemSelector: '.isotope-item', 377 layoutMode: 'masonry', 378 transitionDuration: 'http://htmlcoder.me/preview/idea/v.1.0/js/0.6s', 379 filter: "*" 380 }); 381 // filter items on button click 382 $('.filters').on( 'click', 'ul.nav li a', function() { 383 var filterValue = $(this).attr('data-filter'); 384 $(".filters").find("li.active").removeClass("active"); 385 $(this).parent().addClass("active"); 386 $container.isotope({ filter: filterValue }); 387 return false; 388 }); 389 }); 390 }; 391 392 //hc-tabs 393 //----------------------------------------------- 394 /*if ($('.hc-tabs').length>0) { 395 $(window).load(function() { 396 var currentTab = $(".hc-tabs .nav.nav-tabs li.active a").attr("href"), 397 tabsImageAnimation = $(".hc-tabs-top").find("[data-tab='" + currentTab + "']").attr("data-tab-animation-effect"); 398 $(".hc-tabs-top").find("[data-tab='" + currentTab + "']").addClass("current-img show " + tabsImageAnimation + " animated"); 399 400 $('.hc-tabs .nav.nav-tabs li a').on('click', function(event) { 401 var currentTab = $(this).attr("href"), 402 tabsImageAnimation = $(".hc-tabs-top").find("[data-tab='" + currentTab + "']").attr("data-tab-animation-effect"); 403 $(".current-img").removeClass("current-img show " + tabsImageAnimation + " animated"); 404 $(".hc-tabs-top").find("[data-tab='" + currentTab + "']").addClass("current-img show " + tabsImageAnimation + " animated"); 405 }); 406 }); 407 408 }*/ 409 410 // Animated Progress Bars 411 //----------------------------------------------- 412 if ($("[data-animate-width]").length>0) { 413 $("[data-animate-width]").each(function() { 414 var $this = $(this); 415 $this.appear(function() { 416 $this.animate({ 417 width: $this.attr("data-animate-width") 418 }, 800 ); 419 }
419, {accX: 0, accY: -100}); 420 }); 421 }; 422 423 // Animated Progress Bars 424 //----------------------------------------------- 425 if ($(".knob").length>0) { 426 $(".knob").knob(); 427 } 428 429 // Magnific popup 430 //----------------------------------------------- 431 if (($(".popup-img").length > 0) || ($(".popup-iframe").length > 0) || ($(".popup-img-single").length > 0)) { 432 $(".popup-img").magnificPopup({ 433 type:"image", 434 gallery: { 435 enabled: true, 436 } 437 }); 438 $(".popup-img-single").magnificPopup({ 439 type:"image", 440 gallery: { 441 enabled: false, 442 } 443 }); 444 $('.popup-iframe').magnificPopup({ 445 disableOn: 700, 446 type: 'iframe', 447 preloader: false, 448 fixedContentPos: false 449 }); 450 }; 451 452 // Fixed header 453 //----------------------------------------------- 454 var headerTopHeight = $(".header-top").outerHeight(), 455 headerHeight = $("header.header.fixed").outerHeight(); 456 $(window).scroll(function() { 457 if (($(".header.fixed").length > 0)) { 458 if(($(this).scrollTop() > headerTopHeight+headerHeight) && ($(window).width() > 767)) { 459 $("body").addClass("fixed-header-on"); 460 $(".header.fixed").addClass('animated object-visible fadeInDown'); 461 if ($(".banner:not(.header-top)").length>0) { 462 $(".banner").css("marginTop", (headerHeight)+"px"); 463 } else if ($(".page-intro").length>0) { 464 $(".page-intro").css("marginTop", (headerHeight)+"px"); 465 } else if ($(".page-top").length>0) { 466 $(".page-top").css("marginTop", (headerHeight)+"px"); 467 } else { 468 $("section.main-container").css("marginTop", (headerHeight)+"px"); 469 } 470 } else { 471 $("body").removeClass("fixed-header-on"); 472 $("section.main-container").css("marginTop", (0)+"px"); 473 $(".banner").css("marginTop", (0)+"px"); 474 $(".page-intro").css("marginTop", (0)+"px"); 475 $(".page-top").css("marginTop", (0)+"px"); 476 $(".header.fixed").removeClass('animated object-visible fadeInDown'); 477 } 478 }; 479 }); 480 481 // Sharrre plugin 482 //----------------------------------------------- 483 if ($('#share').length>0) { 484 $('#share').sharrre({ 485 share: { 486 twitter: true, 487 facebook: true, 488 googlePlus: true 489 }, 490 template: '<ul class="social-links clearfix"><li class="facebook"><a href="#"><i class="fa fa-facebook"></i></a></li><li class="twitter"><a href="#"><i class="fa fa-twitter"></i></a></li><li class="googleplus"><a href="#"><i class="fa fa-google-plus"></i></a></li></ul>', 491 enableHover: false, 492 enableTracking: true, 493 render: function(api, options){ 494 $(api.element).on('click', '.twitter a', function() { 495 api.openPopup('twitter'); 496 }); 497 $(api.element).on('click', '.facebook a', function() { 498 api.openPopup('facebook'); 499 }); 500 $(api.element).on('click', '.googleplus a', function() { 501 api.openPopup('googlePlus'); 502 }); 503 } 504 }); 505 }; 506 507 // Contact forms validation 508 //----------------------------------------------- 509 if($("#contact-form").length>0) { 510 $("#contact-form").validate({ 511 submitHandler: function(form) { 512 513 var submitButton = $(this.submitButton); 514 submitButton.button("loading"); 515 516 $.ajax({
517 type: "POST", 518 url: "http://htmlcoder.me/preview/idea/v.1.0/js/php/contact-form.php", 519 data: { 520 "name": $("#contact-form #name").val(), 521 "email": $("#contact-form #email").val(), 522 "subject": $("#contact-form #subject").val(), 523 "message": $("#contact-form #message").val() 524 }, 525 dataType: "json", 526 success: function (data) { 527 if (data.response == "success") { 528 529 $("#contactSuccess").removeClass("hidden"); 530 $("#contactError").addClass("hidden"); 531 532 // Reset Form 533 $("#contact-form .form-control") 534 .val("") 535 .blur() 536 .parent() 537 .removeClass("has-success") 538 .removeClass("has-error") 539 .find("label") 540 .removeClass("hide") 541 .parent() 542 .find("span.error") 543 .remove(); 544 545 if(($("#contactSuccess").position().top - 80) < $(window).scrollTop()){ 546 $("html, body").animate({ 547 scrollTop: $("#contactSuccess").offset().top - 80 548 }, 300); 549 } 550 551 } else { 552 553 $("#contactError").removeClass("hidden"); 554 $("#contactSuccess").addClass("hidden"); 555 556 if(($("#contactError").position().top - 80) < $(window).scrollTop()){ 557 $("html, body").animate({ 558 scrollTop: $("#contactError").offset().top - 80 559 }, 300); 560 } 561 562 } 563 }, 564 complete: function () { 565 submitButton.button("reset"); 566 } 567 }); 568 }, 569 // debug: true, 570 errorPlacement: function(error, element) { 571 error.insertBefore( element ); 572 }, 573 onkeyup: false, 574 onclick: false, 575 rules: { 576 name: { 577 required: true, 578 minlength: 2 579 }, 580 email: { 581 required: true, 582 email: true 583 }, 584 subject: { 585 required: true 586 }, 587 message: { 588 required: true, 589 minlength: 10 590 } 591 }, 592 messages: { 593 name: { 594 required: "Please specify your name", 595 minlength: "Your name must be longer than 2 characters" 596 }, 597 email: { 598 required: "We need your email address to contact you", 599 email: "http://htmlcoder.me/preview/idea/v.1.0/js/Please enter a valid email address e.g. [email protected]" 600 }, 601 subject: { 602 required: "Please enter a subject" 603 }, 604 message: { 605 required: "Please enter a message", 606 minlength: "Your message must be longer than 10 characters" 607 } 608 }, 609 errorElement: "span", 610 highlight: function (element) { 611 $(element).parent().removeClass("has-success").addClass("has-error"); 612 $(element).siblings("label").addClass("hide"); 613 }, 614 success: function (element) { 615 $(element).parent().removeClass("has-error").addClass("has-success"); 616 $(element).siblings("label").removeClass("hide"); 617 } 618 }); 619 }; 620 621 if($("#footer-form").length>0) { 622 $("#footer-form").validate({ 623 submitHandler: function(form) { 624 625 var submitButton = $(this.submitButton); 626 submitButton.button("loading"); 627 628 $.ajax({
629 type: "POST", 630 url: "http://htmlcoder.me/preview/idea/v.1.0/js/php/contact-form.php", 631 data: { 632 "name": $("#footer-form #name2").val(), 633 "email": $("#footer-form #email2").val(), 634 "subject": "Message from contact form", 635 "message": $("#footer-form #message2").val() 636 }, 637 dataType: "json", 638 success: function (data) { 639 if (data.response == "success") { 640 641 $("#contactSuccess2").removeClass("hidden"); 642 $("#contactError2").addClass("hidden"); 643 644 // Reset Form 645 $("#footer-form .form-control") 646 .val("") 647 .blur() 648 .parent() 649 .removeClass("has-success") 650 .removeClass("has-error") 651 .find("label") 652 .removeClass("hide") 653 .parent() 654 .find("span.error") 655 .remove(); 656 657 if(($("#contactSuccess2").position().top - 80) < $(window).scrollTop()){ 658 $("html, body").animate({ 659 scrollTop: $("#contactSuccess2").offset().top - 80 660 }, 300); 661 } 662 663 } else { 664 665 $("#contactError2").removeClass("hidden"); 666 $("#contactSuccess2").addClass("hidden"); 667 668 if(($("#contactError2").position().top - 80) < $(window).scrollTop()){ 669 $("html, body").animate({ 670 scrollTop: $("#contactError2").offset().top - 80 671 }, 300); 672 } 673 674 } 675 }, 676 complete: function () { 677 submitButton.button("reset"); 678 } 679 }); 680 }, 681 // debug: true, 682 errorPlacement: function(error, element) { 683 error.insertAfter( element ); 684 }, 685 onkeyup: false, 686 onclick: false, 687 rules: { 688 name2: { 689 required: true, 690 minlength: 2 691 }, 692 email2: { 693 required: true, 694 email: true 695 }, 696 message2: { 697 required: true, 698 minlength: 10 699 } 700 }, 701 messages: { 702 name2: { 703 required: "Please specify your name", 704 minlength: "Your name must be longer than 2 characters" 705 }, 706 email2: { 707 required: "We need your email address to contact you", 708 email: "http://htmlcoder.me/preview/idea/v.1.0/js/Please enter a valid email address e.g. [email protected]" 709 }, 710 message2: { 711 required: "Please enter a message", 712 minlength: "Your message must be longer than 10 characters" 713 } 714 }, 715 errorElement: "span", 716 highlight: function (element) { 717 $(element).parent().removeClass("has-success").addClass("has-error"); 718 $(element).siblings("label").addClass("hide"); 719 }, 720 success: function (element) { 721 $(element).parent().removeClass("has-error").addClass("has-success"); 722 $(element).siblings("label").removeClass("hide"); 723 } 724 }); 725 }; 726 727 if($("#sidebar-form").length>0) { 728 729 $("#sidebar-form").validate({ 730 submitHandler: function(form) { 731 732 var submitButton = $(this.submitButton); 733 submitButton.button("loading"); 734 735 $.ajax({
736 type: "POST", 737 url: "http://htmlcoder.me/preview/idea/v.1.0/js/php/contact-form.php", 738 data: { 739 "name": $("#sidebar-form #name3").val(), 740 "email": $("#sidebar-form #email3").val(), 741 "subject": "Message from FAQ page", 742 "category": $("#sidebar-form #category").val(), 743 "message": $("#sidebar-form #message3").val() 744 }, 745 dataType: "json", 746 success: function (data) { 747 if (data.response == "success") { 748 749 $("#contactSuccess3").removeClass("hidden"); 750 $("#contactError3").addClass("hidden"); 751 752 // Reset Form 753 $("#sidebar-form .form-control") 754 .val("") 755 .blur() 756 .parent() 757 .removeClass("has-success") 758 .removeClass("has-error") 759 .find("label") 760 .removeClass("hide") 761 .parent() 762 .find("span.error") 763 .remove(); 764 765 if(($("#contactSuccess3").position().top - 80) < $(window).scrollTop()){ 766 $("html, body").animate({ 767 scrollTop: $("#contactSuccess3").offset().top - 80 768 }, 300); 769 } 770 771 } else { 772 773 $("#contactError3").removeClass("hidden"); 774 $("#contactSuccess3").addClass("hidden"); 775 776 if(($("#contactError3").position().top - 80) < $(window).scrollTop()){ 777 $("html, body").animate({ 778 scrollTop: $("#contactError3").offset().top - 80 779 }, 300); 780 } 781 782 } 783 }, 784 complete: function () { 785 submitButton.button("reset"); 786 } 787 }); 788 }, 789 // debug: true, 790 errorPlacement: function(error, element) { 791 error.insertAfter( element ); 792 }, 793 onkeyup: false, 794 onclick: false, 795 rules: { 796 name3: { 797 required: true, 798 minlength: 2 799 }, 800 email3: { 801 required: true, 802 email: true 803 }, 804 message3: { 805 required: true, 806 minlength: 10 807 } 808 }, 809 messages: { 810 name3: { 811 required: "Please specify your name", 812 minlength: "Your name must be longer than 2 characters" 813 }, 814 email3: { 815 required: "We need your email address to contact you", 816 email: "http://htmlcoder.me/preview/idea/v.1.0/js/Please enter a valid email address e.g. [email protected]" 817 }, 818 message3: { 819 required: "Please enter a message", 820 minlength: "Your message must be longer than 10 characters" 821 } 822 }, 823 errorElement: "span", 824 highlight: function (element) { 825 $(element).parent().removeClass("has-success").addClass("has-error"); 826 }, 827 success: function (element) { 828 $(element).parent().removeClass("has-error").addClass("has-success"); 829 } 830 }); 831 832 }; 833 834 // Affix plugin 835 //----------------------------------------------- 836 if ($("#affix").length>0) { 837 $(window).load(function() { 838 839 var affixBottom = $(".footer").outerHeight(true) + $(".subfooter").outerHeight(true) + $(".blogpost footer").outerHeight(true), 840 affixTop = $("#affix").offset().top; 841 842 if ($(".comments").length>0) { 843 affixBottom = affixBottom + $(".comments").outerHeight(true); 844 } 845 846 if ($(".comments-form").length>0) { 847 affixBottom = affixBottom + $(".comments-form").outerHeight(true); 848 } 849 850 if ($(".footer-top").length>0) { 851 affixBottom = affixBottom + $(".footer-top").outerHeight(true); 852 } 853 854 if ($(".header.fixed").length>0) { 855 $("#affix").affix({ 856 offset: { 857 top: affixTop-150, 858 bottom: affixBottom+100 859 } 860 }); 861 } else { 862 $("#affix").affix({ 863 offset: { 864 top: affixTop-35, 865 bottom: affixBottom+100 866 } 867 }); 868 } 869 870 }); 871 } 872 if ($(".affix-menu").length>0) { 873 setTimeout(function () { 874 var $sideBar = $('.sidebar') 875 876 $sideBar.affix({ 877 offset: { 878 top: function () { 879 var offsetTop = $sideBar.offset().top 880 return (this.top = offsetTop - 65) 881 }, 882 bottom: function () { 883 var affixBottom = $(".footer").outerHeight(true) + $(".subfooter").outerHeight(true) 884 if ($(".footer-top").length>0) { 885 affixBottom = affixBottom + $(".footer-top").outerHeight(true) 886 } 887 return (this.bottom = affixBottom+50) 888 } 889 } 890 }) 891 }, 100) 892 } 893 894 //Smooth Scroll 895 //----------------------------------------------- 896 if ($(".smooth-scroll").length>0) { 897 if($(".header.fixed").length>0) { 898 $('.smooth-scroll a[href*=#]:not([href=#]), a[href*=#]:not([href=#]).smooth-scroll').click(function() { 899 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 900 var target = $(this.hash); 901 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 902 if (target.length) { 903 $('html,body').animate({ 904 scrollTop: target.offset().top-65 905 }, 1000); 906 return false; 907 } 908 } 909 }); 910 } else { 911 $('.smooth-scroll a[href*=#]:not([href=#]), a[href*=#]:not([href=#]).smooth-scroll').click(function() { 912 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 913 var target = $(this.hash); 914 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 915 if (target.length) { 916 $('html,body').animate({ 917 scrollTop: target.offset().top 918 }, 1000); 919 return false; 920 } 921 } 922 }); 923 } 924 } 925 926 //Scroll Spy 927 //----------------------------------------------- 928 if($(".scrollspy").length>0) { 929 $("body").addClass("scroll-spy"); 930 if($(".fixed.header").length>0) { 931 $('body').scrollspy({ 932 target: '.scrollspy', 933 offset: 85 934 }); 935 } else { 936 $('body').scrollspy({ 937 target: '.scrollspy', 938 offset: 20 939 }); 940 } 941 } 942 943 //Scroll totop 944 //----------------------------------------------- 945 $(window).scroll(function() { 946 if($(this).scrollTop() != 0) { 947 $(".scrollToTop").fadeIn(); 948 } else { 949 $(".scrollToTop").fadeOut(); 950 } 951 }); 952 953 $(".scrollToTop").click(function() { 954 $("body,html").animate({scrollTop:0},800); 955 }); 956 957 //Modal 958 //----------------------------------------------- 959 if($(".modal").length>0) { 960 $(".modal").each(function() { 961 $(".modal").prependTo( "body" ); 962 }); 963 } 964 965 // Pricing tables popovers 966 //----------------------------------------------- 967 if ($(".pricing-tables").length>0) { 968 $(".plan .pt-popover").popover({ 969 trigger: 'hover' 970 }); 971 }; 972 973 // Parallax section 974 //----------------------------------------------- 975 if (($(".parallax").length>0) && !Modernizr.touch ){ 976 $(".parallax").parallax("50%", 0.2, false); 977 }; 978 979 // Remove Button 980 //----------------------------------------------- 981 $(".btn-remove").click(function() { 982 $(this).closest(".remove-data").remove(); 983 }); 984 985 // Shipping Checkbox 986 //----------------------------------------------- 987 if ($("#shipping-info-check").is(':checked')) { 988 $("#shipping-information").hide(); 989 } 990 $("#shipping-info-check").change(function(){ 991 if ($(this).is(':checked')) { 992 $("#shipping-information").slideToggle(); 993 } else { 994 $("#shipping-information").slideToggle(); 995 } 996 }); 997 998 }); // End document ready 999 1000})(this.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.