12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- jQuery(document).ready(function($) {
- $('.nav-toggle').on( 'click', function() {
- $( this ).toggleClass( 'active' );
- });
- $(window).bind("load", function () {
- $('#loader').fadeOut(900);
- });
-
- var headerHeight = $('.navbar').height();
- $(window).on('scroll', { previousTop: 0 },
- function() {
- var currentTop = $(window).scrollTop();
- if (currentTop < this.previousTop) {
- if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
- $('.navbar').addClass('visible');
- } else {
- $('.navbar').removeClass('visible fixed');
- }
- } else {
- $('.navbar').removeClass('visible');
- if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
- }
- this.previousTop = currentTop;
- });
- var commentsDiv = $('#comments');
- if (commentsDiv.length) {
- $(commentsDiv).hide();
- $('.toggle-comments').on('click', function(e) {
- e.preventDefault();
- $(commentsDiv).toggle('slow', function() {
- var anchor = $('.toggle-comments');
- var anchorText = anchor.text() === 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
- $(anchor).text(anchorText);
- });
- });
- }
- });
- ;(function ($) {
- 'use strict';
- var $body = $('html, body'),
- content = $('#big-top').smoothState({
- prefetch: true,
- pageCacheSize: 4,
- onStart: {
- duration: 250,
- render: function (url, $container) {
- content.toggleAnimationClass('is-exiting');
- $body.animate({
- scrollTop: 0
- });
- }
- }
- }).data('smoothState');
- })(jQuery);
|