With other words I want to do workaround of position: fixed....
On Aug 15, 11:01 pm, nyankov <[email protected]> wrote: > Hello, > > I am wondering. What is the way to implement toolbar in browser > window. I want the toolbar to be fixed on window bottom always (even > on scrolling and resize). Also I want the toolbar to be just a widget. > > Here what I already did, but on scrolling the panal flickering.... > > package com.mycompany.project.client; > > import com.google.gwt.core.client.EntryPoint; > import com.google.gwt.event.logical.shared.ResizeEvent; > import com.google.gwt.event.logical.shared.ResizeHandler; > import com.google.gwt.user.client.DOM; > import com.google.gwt.user.client.Window; > import com.google.gwt.user.client.Window.ScrollEvent; > import com.google.gwt.user.client.Window.ScrollHandler; > import com.google.gwt.user.client.ui.RootPanel; > import com.google.gwt.user.client.ui.Button; > import com.google.gwt.user.client.ui.AbsolutePanel; > > public class GwtTest implements EntryPoint { > public void onModuleLoad() { > RootPanel rootPanel = RootPanel.get(); > final AbsolutePanel absolutePanel = new AbsolutePanel(); > rootPanel.add(absolutePanel, 0, 244); > absolutePanel.setSize("100%", "51px"); > Button button1 = new Button("New button"); > Button button2 = new Button("New button"); > Button button3 = new Button("New button"); > absolutePanel.add(button1); > absolutePanel.add(button2); > absolutePanel.add(button3); > > com.google.gwt.user.client.Element h = > absolutePanel.getElement(); > DOM.setStyleAttribute(h, "top", > (Window.getClientHeight()-51)+"px"); > > Window.addWindowScrollHandler(new ScrollHandler() { > @Override > public void onWindowScroll(ScrollEvent event) { > com.google.gwt.user.client.Element h = > absolutePanel.getElement(); > DOM.setStyleAttribute(h, "top", > (Window.getClientHeight() > +event.getScrollTop()-51)+"px"); > } > }); > > Window.addResizeHandler(new ResizeHandler() { > @Override > public void onResize(ResizeEvent event) { > com.google.gwt.user.client.Element h = > absolutePanel.getElement(); > DOM.setStyleAttribute(h, "top", > (event.getHeight()-51)+"px"); > } > }); > } > > } > > Thank you in advance --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
