/** * cf-scrips.js * * Handles the Bootstrap Carousel, Boostrap Back To Top and isInViewport.min.js */ $(document).ready(function() { var slideqty = $('#fade-quote-carousel .item').length; var randSlide = Math.floor(Math.random()*slideqty); $('#fade-quote-carousel .item').eq(randSlide).addClass('active'); for (var i=0; i < slideqty; i++) { var insertText = '
  • '; $('#fade-quote-carousel ol').append(insertText); } }); $('.carousel').carousel({ interval: 6000 //changes the speed }) // Only enable if the document has a long scroll bar // Note the window height + offset if ( ($(window).height() + 100) < $(document).height() ) { $('#top-link-block').removeClass('hidden').affix({ // how far to scroll down before link "slides" into view offset: {top:100} }); } $(document).ready(function() { // check height of comments div $commentsHeight = $("#comments").height(); // if the height is empty/nothing, then hide the div containing it if ($commentsHeight < 1) { $("#comments").parent().css("display", "none"); } // check height of footer outer contents div $footerOuterContentsHeight = $("body > .footer-outer .row").height(); // if the height is empty/nothing, then hide the div containing it if ($footerOuterContentsHeight < 2) { $("body > .footer-outer .row").parent().css("display", "none"); } });