Gwt using jquery effect?

in my gwt, I have a button that fires, as shown below, to create a new widget

 @UiHandler("buttonfire")
  void addNewWidget(ClickEvent event) {


     htmlPanelHolder.add(new MyCustomWidget(),"placeholder");

 }

how to use jquery so that when displaying MyCustomWidget () on the screen, the jQuery fadein effect is used

I already tried to put jsni on a jquery call inside the new MyCustomWidget () onload (), but it does not work. can help me with this?

+3
source share
3 answers

It is also possible to create a fade effect without using jQuery. If you want to do this, simply write an animation class as follows:

public class FadeInAnimation extends Animation {
    private final UIObject uiObject;

    FadeInAnimation(final UIObject uiObject) {
      this.uiObject = uiObject;
    }

    @Override
    protected void onUpdate(final double progress) {
      uiObject.getElement().getStyle().setOpacity(progress);
    }
}

Then you can use it for any widget:

new FadeInAnimation(myWidget).run(5000);

: getStyle().setOpacity(..) IE6/7, style.filter = 'alpha(opacity=' + (value * 100) + ')';

+11

Source: https://habr.com/ru/post/1776443/


All Articles