Don't have scrollhandler fire when the 'home' tab isn't active.

(imported from commit 242591730e5ce108c511e4eeaad7589d768b1b94)
This commit is contained in:
Waseem Daher 2012-10-05 13:22:43 -04:00
parent 6d37154a36
commit 32758e2e4b
1 changed files with 6 additions and 4 deletions

View File

@ -120,10 +120,12 @@ $(function () {
var last_mousewheel_or_scroll = 0;
function do_mousewheel_or_scroll () {
var time = $.now();
if (time - last_mousewheel_or_scroll > 50) {
keep_pointer_in_view();
last_mousewheel_or_scroll = time;
if ($('#home').hasClass('active')) {
var time = $.now();
if (time - last_mousewheel_or_scroll > 50) {
keep_pointer_in_view();
last_mousewheel_or_scroll = time;
}
}
}
$(window).mousewheel(do_mousewheel_or_scroll);