123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- function scroll_to(clicked_link, nav_height) {
- var element_class = clicked_link.attr('href').replace('#', '.');
- var scroll_to = 0;
- if(element_class != '.top-content') {
- element_class += '-container';
- scroll_to = $(element_class).offset().top - nav_height;
- }
- if($(window).scrollTop() != scroll_to) {
- $('html, body').stop().animate({scrollTop: scroll_to}, 1000);
- }
- }
- jQuery(document).ready(function() {
- /*
- Navigation
- */
- $('a.scroll-link').on('click', function(e) {
- e.preventDefault();
- scroll_to($(this), 0);
- });
- /*
- Background slideshow
- */
- // $('.top-content').backstretch("assets/img/backgrounds/1.jpg");
- // $('.how-it-works-container').backstretch("assets/img/backgrounds/1.jpg");
- // $('.call-to-action-container').backstretch("assets/img/backgrounds/1.jpg");
- $('#top-navbar-1').on('shown.bs.collapse', function(){
- $('.top-content').backstretch("resize");
- });
- $('#top-navbar-1').on('hidden.bs.collapse', function(){
- $('.top-content').backstretch("resize");
- });
- /*
- Wow
- */
- new WOW().init();
- /*
- Modals
- */
- $('.launch-modal').on('click', function(e){
- e.preventDefault();
- $( '#' + $(this).data('modal-id') ).modal();
- });
- });
- jQuery(window).load(function() {
- /*
- Loader
- */
- $(".loader-img").fadeOut();
- $(".loader").delay(1000).fadeOut("slow");
- /*
- Hidden images
- */
- $(".modal-body img, .testimonial-image img, #slider-1 img").attr("style", "width: auto !important; height: auto !important;");
- });
|