I'm developing application with GWT 2 and would like to add float panel that stick to the bottom of the screen (not page, like chat panel in facebook). What is the best way to make that kind of panel?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If I understood you correctly, you should apply the style below to a Panel (any basic Panel should do: FlowPanel
, HTMLPanel
, etc) and add it to the body (it doesn't have to be <body>
but we know that it's always there and won't be removed ;)) via RootPanel.get().add(fixedPanel);
position: absolute; /* Or fixed - depends on what you want */
right: 0; /* The part that puts the Panel in bottom right of the page/client area */
bottom: 0;
回答2:
This can be done by adding the CSS attribute position: fixed
to the div in question.
Read more here: http://www.quirksmode.org/css/position.html
回答3:
I think you can do this by CSS. All you need is any GWT Panel and then style it using CSS. Check out http://www.lwis.net/journal/2008/02/08/pure-css-sticky-footer/