Changeset 30808
- Timestamp:
- 12/10/2014 11:01:03 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/js/functions.js
r30804 r30808 7 7 8 8 ( function( $ ) { 9 var $body, $window, $ document, $sidebar, adminbarOffset, top = false,10 11 topOffset = 0, documentHeight, sidebarHeight, resizeTimer;9 var $body, $window, $sidebar, adminbarOffset, top = false, 10 bottom = false, windowWidth, windowHeight, lastWindowPos = 0, 11 topOffset = 0, bodyHeight, sidebarHeight, resizeTimer; 12 12 13 13 // Add dropdown toggle that display child menu items. … … 53 53 // Sidebar scrolling. 54 54 function resize() { 55 windowWidth = $window.width();56 windowHeight = $window.height();57 documentHeight = $document.height();55 windowWidth = $window.width(); 56 windowHeight = $window.height(); 57 bodyHeight = $body.height(); 58 58 sidebarHeight = $sidebar.height(); 59 59 … … 67 67 var windowPos = $window.scrollTop(); 68 68 69 if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < documentHeight ) {69 if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < bodyHeight ) { 70 70 if ( sidebarHeight + adminbarOffset > windowHeight ) { 71 71 if ( windowPos > lastWindowPos ) { … … 107 107 108 108 $( document ).ready( function() { 109 $body = $( 'body');109 $body = $( document.body ); 110 110 $window = $( window ); 111 $document = $( document ); 112 $sidebar = $( '#sidebar' ).first(); 111 $sidebar = $( '#sidebar' ).first(); 113 112 adminbarOffset = $body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0; 114 113
Note: See TracChangeset
for help on using the changeset viewer.