2010-04-13 53 views
3

我正在開發帶有GWT 2的應用程序,並希望添加粘貼到屏幕底部的浮動面板(不是頁面,如Facebook中的聊天面板)。製作這種面板的最佳方式是什麼?GWT中的浮動面板

回答

4

如果我理解正確的話,你應該應用下面的風格到面板(任何基本的面板應該做的:FlowPanelHTMLPanel等),並把它添加到身體(它不到是<body>但我們知道,它總是在那裏,並不會被刪除;))通過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

這可以通過將CSS屬性position: fixed添加到所討論的div來完成。

更多在這裏閱讀:http://www.quirksmode.org/css/position.html

+0

但我怎麼把它放在瀏覽器窗口的右下角? – Maksim 2010-04-13 23:06:34

+0

職位:固定; bottom:0px; right:0px; – 2010-04-14 04:55:38