Response title
This is preview!
/*-----------------------------------------------------------------------------------*/ /* SCROLL EFFECTS & HEADER /*-----------------------------------------------------------------------------------*/ jQuery(window).load(function($){ 'use strict'; /** * Page Loaded Stuff */ jQuery('#page-loader').addClass('animated fadeOutDown'); jQuery('body, html').addClass('window-loaded'); jQuery('.light.scroller').animate({ 'opacity' : '1' }); /** * Scroll Animations */ jQuery('.animated').espy(function (entered, state) { var $this = jQuery(this); if (entered){ $this.addClass( $this.attr('data-animation') ); } }); // Bind the event. jQuery(window).hashchange( function(){ var url = location.hash; var minus = 64; if( jQuery('body').hasClass('admin-bar') ) var minus = 96; if( url ) jQuery("html, body").animate({ scrollTop: jQuery(url).offset().top - minus }, 500); }); // Trigger the event (useful on page load). jQuery(window).hashchange(); jQuery('#selectnav .scroller > a').click(function(){ var $this = jQuery(this); jQuery('#selectnav .scroller').removeClass('active'); $this.parent().addClass('active'); jQuery('#selectnav .scroller a').removeClass('active'); $this.addClass('active'); history.pushState(null, null, $this.attr('href')); jQuery(window).hashchange(); return false; }); jQuery('a.scroller').click(function(){ history.pushState(null, null, jQuery(this).attr('href')); jQuery(window).hashchange(); return false; }); jQuery(window).scroll(function(){ var scrollTop = jQuery(window).scrollTop() / 12; var $header = jQuery('header#main-header'); var $sub = jQuery('#selectnav ul'); if( scrollTop < 20 ){ $header.css({ 'padding-top' : 25 - scrollTop, 'padding-bottom' : 25 - scrollTop }); $sub.css({ 'padding-top' : 42 - scrollTop }); } else { $header.css({ 'padding-top' : 5, 'padding-bottom' : 5 }); $sub.css({ 'padding-top' : 22 }); } jQuery('#selectnav .scroller > a').each(function(){ var scrollHref = jQuery(this).attr('href'); if( jQuery(scrollHref).length > 0 ){ if( jQuery(window).scrollTop() > jQuery(scrollHref).offset().top - 240 ) { jQuery('#selectnav .scroller').removeClass('active'); jQuery(this).parent().addClass('active'); } } }); }); });
© 2013 jQuery Foundation
Sponsored by and others.