Initial commit
This commit is contained in:
18
js/floatmenu_init.js
Normal file
18
js/floatmenu_init.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// change the menu position based on the scroll position
|
||||
window.onscroll = function() {
|
||||
|
||||
var toolbar = jQuery( '#gf_form_toolbar' );
|
||||
var floatMenu = jQuery( '#floatMenu' );
|
||||
|
||||
if( window.XMLHttpRequest && toolbar.length > 0 ) {
|
||||
|
||||
var basePosition = toolbar.offset().top;
|
||||
|
||||
if( document.documentElement.scrollTop > basePosition || self.pageYOffset > basePosition ) {
|
||||
floatMenu.css( { position: 'fixed', top: '40px' } );
|
||||
} else {
|
||||
floatMenu.css( { position: 'static', top: '40px' } );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user