PDA

View Full Version : window.scrollTo problem



tzaman
18 Aug 2009, 1:02 PM
Hi, I'm trying to use scrollTo method on a window, and it only 'jumps' to that point, it will not animate (scroll smoothly), like if i use scrollTo on an scrollable object.

My code:


Ext.onReady(function() {
Ext.select('a.button').on('click',function(e,t) {
object = Ext.get(this);
window.scrollTo("b", object.getY()-10, true);
});
});

Can someone help me in achieving a smooth scrolling?

Thanx,Tom

tzaman
18 Aug 2009, 4:04 PM
I partially solved the problem,
i changed the line

window.scrollTo("b", object.getY()-10, true);to line

Ext.getBody().scrollTo("top", object.getY()-10, true);then i added some css:


html{height:100%;overflow:hidden}
body{height:100%;overflow:scroll}
This solution works in FF on mac but not in Safari.

I'm using a strict DOCTYPE and i can't loose that.