开发者

How to set the main page's DOCTYPE declaration in Vaadin

I'm having issues with scroll offset detection that seem to be related with the DOCTYPE declaration:

Using Doctype let scrollTop return 0, why?

As I am using Vaadin, I need to have it strip off this declaration fr开发者_Python百科om the main page.

How can I do that?


You can change the doctype by overriding AbstractApplicationServlet.writeAjaxPageHtmlHeadStart() (i.e by extending ApplicationServlet and referencing your implementation in web.xml).

However:

  1. The problem you're seeing might not be related to the doctype at all!
  2. Vaadin really must not be in quirks-mode.

Regarding 1: Are you trying to read scrollTop for the entire document? Vaadin applications often scroll within the main div in which it is rendered, not the whole page.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜