开发者

Prevent scrolling to content in jQuery tabs

I'm working on a page that uses jQuery tabs. It's pretty much completed, but I've run into one minor annoyance. 开发者_运维百科If the content of the tab is longer than the available window height, it automatically scrolls down to the start of the content. This makes sense, since behind the screens it's just an tag pointing to the id of the content. However, this is fairly annoying since now you have to scroll up to see the tab bar.

I've tried to add window.scroll(0, 0) to the tabsshow event, but that didn't do anything.

Does anyone happen to know a way to stay at the top of the page when a jQuery tab is clicked?


Fixed it. The problem was not with jQuery, but with trying to draw a jsCharts graph with no data which apparently causes the document to scroll.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜