summaryrefslogtreecommitdiff
path: root/resources/src/jquery/jquery.footHovzer.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/src/jquery/jquery.footHovzer.js')
-rw-r--r--resources/src/jquery/jquery.footHovzer.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/resources/src/jquery/jquery.footHovzer.js b/resources/src/jquery/jquery.footHovzer.js
index de745c33..e601ddb1 100644
--- a/resources/src/jquery/jquery.footHovzer.js
+++ b/resources/src/jquery/jquery.footHovzer.js
@@ -2,7 +2,7 @@
* @class jQuery.plugin.footHovzer
*/
( function ( $ ) {
- var $hovzer, footHovzer, prevHeight, newHeight;
+ var $hovzer, footHovzer, $spacer;
function getHovzer() {
if ( $hovzer === undefined ) {
@@ -46,15 +46,15 @@
var $body;
$body = $( 'body' );
- if ( prevHeight === undefined ) {
- prevHeight = getHovzer().outerHeight( /* includeMargin = */ true );
- $body.css( 'paddingBottom', '+=' + prevHeight + 'px' );
- } else {
- newHeight = getHovzer().outerHeight( true );
- $body.css( 'paddingBottom', ( parseFloat( $body.css( 'paddingBottom' ) ) - prevHeight ) + newHeight );
- prevHeight = newHeight;
+ if ( $spacer === undefined ) {
+ $spacer = $( '<div>' ).attr( 'id', 'jquery-foot-hovzer-spacer' );
+ $spacer.appendTo( $body );
}
+ // Ensure CSS is applied by browser before using .outerHeight()
+ setTimeout( function () {
+ $spacer.css( 'height', getHovzer().outerHeight( /* includeMargin = */ true ) );
+ }, 0 );
}
};