Hi Isomorphic,
I have an spurious client-side effect I can't explain using latest 5.1p and 6.1d.
Sometimes it appears, sometimes after a F5 it does not. I'd say I have it in about 10% of the page loads.
My application has a fixed width left side menu.
The menu consists of VLayouts with a inner HLayout (with inner Img) and a Label.
It also has MouseOverHandler and MouseOutHandler to create the hover effect.
The css is like this:
Do you see any problem with the now commented out transition-CSS in .menuButtonMouseOver, .menuButtonMouseOut?
With your best guess: Could these rules interfere with some size-determination and positioning the framework does, causing the menu entries to jump or move a few pixels (mostly 3 pixels)?
If so, is it valid to use those rules? I'd then try to create a testcase.
Thank you & Best regards
Blama
I have an spurious client-side effect I can't explain using latest 5.1p and 6.1d.
Sometimes it appears, sometimes after a F5 it does not. I'd say I have it in about 10% of the page loads.
My application has a fixed width left side menu.
The menu consists of VLayouts with a inner HLayout (with inner Img) and a Label.
It also has MouseOverHandler and MouseOutHandler to create the hover effect.
Code:
public class NavigationButtonField extends VLayout { private static I18n i18n = GWT.create(I18n.class); public enum Mode { USERACCOUNT("[SKINIMG]LT/navigation/accounts", i18n.userAccount()), ... ... ... ; private String icon; private String title; private Mode(String icon, String title) { this.icon = icon; this.title = title; } public String getIcon() { return this.icon; } public String getTitle() { return this.title; } } final private static String iconExtension = ".png"; private MainArea mainArea; private NavigationVLayout navigationVLayout; private Mode mode; private Label label; private Img img; private Boolean isClicked = false; public void setIsClicked(Boolean isClicked) { this.isClicked = isClicked; } public NavigationButtonField(final Mode mode, MainArea mainArea, NavigationVLayout navigationVLayout) { super(0); this.mainArea = mainArea; this.navigationVLayout = navigationVLayout; this.mode = mode; setHeight(80); setWidth(190); setOverflow(Overflow.HIDDEN); setAlign(Alignment.CENTER); setStyleName("menuButtonMouseNormal"); HLayout hL = new HLayout(0) { { img = new Img(mode.getIcon() + iconExtension, 48, 48); img.setCursor(Cursor.HAND); img.addClickHandler(new FieldClickHandler()); setHeight(48); setAlign(Alignment.CENTER); setMembers(img); } }; label = new WhiteLabel(mode.getTitle()) { { setHeight(20); setAlign(Alignment.CENTER); setCursor(Cursor.HAND); } }; label.addClickHandler(new FieldClickHandler()); setMembers(hL, label); addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { if (!isClicked) { img.setSrc(mode.getIcon() + "_Rollover" + iconExtension); setStyleName("menuButtonMouseOver"); } } }); addMouseOutHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { if (!isClicked) { img.setSrc(mode.getIcon() + iconExtension); img.setHeight(48); img.setWidth(48); setStyleName("menuButtonMouseOut"); } } }); } public void resetDesign() { isClicked = false; img.setSrc(mode.getIcon() + iconExtension); img.setHeight(48); img.setWidth(48); setStyleName("menuButtonMouseOut"); } public Mode getMode() { return mode; } public void click() { isClicked = true; img.setSrc(mode.getIcon() + "_Active" + iconExtension); img.setHeight(48); img.setWidth(48); setStyleName("menuButtonClicked"); NavigationButtonField.this.navigationVLayout.resetButtonDesign(mode); NavigationButtonField.this.mainArea.openModule(mode); } private final class FieldClickHandler implements ClickHandler { @Override public void onClick(ClickEvent event) { NavigationButtonField.this.click(); } } }
Code:
.menuButtonMouseNormal { font-weight: normal; background-color: inherit; } .menuButtonMouseOver, .menuButtonMouseOut { font-weight: normal; /* Causes the jumping box issue -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -webkit-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; */ } .menuButtonMouseOver { background-color: #1C1E25; } .menuButtonMouseOut { background-color: inherit; } .menuButtonClicked { background-color: #1C1E25; font-weight: bold; background: transparent url(./images/LT/hover/menuhover.png) no-repeat right center; }
With your best guess: Could these rules interfere with some size-determination and positioning the framework does, causing the menu entries to jump or move a few pixels (mostly 3 pixels)?
If so, is it valid to use those rules? I'd then try to create a testcase.
Thank you & Best regards
Blama
Comment