开发者

Chrome 5 problem with scroll

 $(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 row开发者_JS百科s 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...


try to call:

event.preventDefault();
event.stopPropagation();
return(false);

ALL three.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜