diff options
Diffstat (limited to 'src/jquery-impromptu.js')
-rw-r--r-- | src/jquery-impromptu.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jquery-impromptu.js b/src/jquery-impromptu.js index e1c0708..4558d59 100644 --- a/src/jquery-impromptu.js +++ b/src/jquery-impromptu.js @@ -629,7 +629,8 @@ bodyHeight = document.body.scrollHeight, //$(document.body).outerHeight(true),
windowHeight = $(window).height(),
documentHeight = $(document).height(),
- height = bodyHeight > windowHeight ? bodyHeight : windowHeight,
+ scroll = (bodyHeight > windowHeight),
+ height = scroll ? bodyHeight : windowHeight,
top = parseInt($window.scrollTop(),10) + (t.options.top.toString().indexOf('%') >= 0?
(windowHeight*(parseInt(t.options.top,10)/100)) : parseInt(t.options.top,10));
@@ -672,7 +673,9 @@ width: (pos.width !== undefined)? pos.width : null
});
top = (offset.top + pos.y) - (t.options.top.toString().indexOf('%') >= 0? (windowHeight*(parseInt(t.options.top,10)/100)) : parseInt(t.options.top,10));
- $('html,body').animate({ scrollTop: top }, 'slow', 'swing', function(){});
+ if(scroll){
+ $('html,body').animate({ scrollTop: top }, 'slow', 'swing', function(){});
+ }
}
}
// custom state width animation
|