Chrome 5 problem with scroll

Posted by Parhs on Stack Overflow See other posts from Stack Overflow or by Parhs
Published on 2010-04-08T17:14:21Z Indexed on 2010/04/08 17:33 UTC
Read the original article Hit count: 432

Filed under:
|
|
 $(document).keydown(function (event)
{

    if(event.keyCode==38 || event.keyCode==40)
    {
        var row;
        if(event.keyCode==40) row=$(row_selected).next();
        if(event.keyCode==38) row=$(row_selected).prev();

        if(row.length==0)
        {
            row=$(row_selected);
        }
        row_select( row );
        var row_position_bottom=$(row).height() +$(row).offset().top;

        var doc_position=$(window).height()  + $(window).scrollTop();
        if(row_position_bottom >doc_position) $(window).scrollTop(row_position_bottom-$(window).height());
        if($(row).offset().top < $(window).scrollTop()) $(window).scrollTop($(row).offset().top);

       return false;
    }

});

Hello i used this code to select rows of my table...If the selection isnt visible page scrolls... It works great ,FIrefox,Internet Explorer,Safari, but not in chrome..... In Chrome 4 not the last version it worked great!!!

The problem is that return false doesnt prevent the page from scrolling...

© Stack Overflow or respective owner

Related posts about chrome

Related posts about google