List of usage examples for com.google.gwt.query.client.plugins Effects Effects
Effects
From source file:com.pronoiahealth.olhie.client.widgets.newsdisplay.NewsDisplay.java
License:Open Source License
/** * Set up the fade timer and set the initial item to display. *///from w w w. j av a 2 s . com @PostConstruct private void postConstruct() { // Set initial news item setCurrentNewsItem(false); fadeTimer = new Timer() { @Override public void run() { if (newsItems != null && newsItems.size() > 0) { $("#fadeNewsDisplay").css(Properties.create("opacity: 1.0;")).show(); $("#fadeNewsDisplay").as(Effects.Effects).fadeOut(newsFadeInterval, new Function() { @Override public void f(Element e) { setCurrentNewsItem(true); $(e).show(); } }); } } }; fadeTimer.scheduleRepeating(newsFadeInterval + 2000); }
From source file:com.qualogy.qafe.gwt.client.util.QEffects.java
License:Apache License
public static void fadeIn(final UIObject ui, final int delay, final int startIn) { final Effects a = $(ui.getElement()).as(Effects.Effects); new Timer() { @Override/* w w w . j a v a 2 s. co m*/ public void run() { $(ui.getElement()).fadeIn(delay, new Function() { public void f(Element e) { //a.fadeIn(); } }); } }.schedule(startIn); }
From source file:com.qualogy.qafe.gwt.client.util.QEffects.java
License:Apache License
public static void fadeOut(final UIObject ui, final int delay, final int startIn, final boolean visibleAfterFadingOut) { final Effects a = $(ui.getElement()).as(Effects.Effects); new Timer() { @Override//from w w w .ja va2 s.c o m public void run() { $(ui.getElement()).fadeOut(delay, new Function() { public void f(Element e) { //a.fadeOut(); ui.setVisible(visibleAfterFadingOut); } }); } }.schedule(startIn); }
From source file:gwtquery.plugins.draggable.client.DraggableHandler.java
License:Apache License
public void revertToOriginalPosition(Function function) { Properties oldPosition = Properties.create("{top:'" + String.valueOf(originalPosition.top) + "px',left:'" + String.valueOf(originalPosition.left) + "px'}"); helper.as(Effects.Effects).animate(oldPosition, options.getRevertDuration(), Easing.LINEAR, function); }
From source file:gwtquery.samples.client.GwtQueryEffectsModule.java
License:Apache License
public void onModuleLoad() { $("div > div").css(CSS.COLOR.with(RGBColor.BLUE)).hover(lazy().css(CSS.COLOR.with(RGBColor.RED)).done(), lazy().css(CSS.COLOR.with(RGBColor.BLUE)).done()); $("div.outer > div").css(CSS.POSITION.with(Position.RELATIVE)).dblclick(new Function() { public boolean f(Event e) { $("div.outer > div").as(Effects.Effects).animate($$("left: '+=100'"), 400, Easing.LINEAR) .animate($$("top: '+=100'"), 400, Easing.LINEAR) .animate($$("left: '-=100'"), 400, Easing.LINEAR) .animate($$("top: '-=100'"), 400, Easing.LINEAR); return true; }//from w ww . j av a 2s . c o m }); $(".note").click(lazy().fadeOut().done()); $(".note").append(" Hello"); final Effects a = $(".a, .b > div:nth-child(2)").as(Effects.Effects); final Effects b = $(".b > div:nth-child(odd)").as(Effects.Effects); $("#b0").width(150).css(CSS.FONT_SIZE.with(Length.px(10))).toggle(new Function() { public void f(Element e) { $("#b0").as(Effects.Effects) .animate(" width: '400', opacity: '0.4', marginLeft: '0.6in', fontSize: '24px'"); } }, new Function() { public void f(Element e) { $("#b0").as(Effects.Effects) .animate(" width: '150', opacity: '1', marginLeft: '0', fontSize: '10px'"); } }); $("#b1").toggle(new Function() { public void f(Element e) { $(".a").toggle(); } }, new Function() { public void f(Element e) { a.fadeOut(); } }, new Function() { public void f(Element e) { a.fadeIn(); } }, new Function() { public void f(Element e) { a.slideUp(); } }, new Function() { public void f(Element e) { a.slideDown(); } }, new Function() { public void f(Element e) { a.slideLeft(); } }, new Function() { public void f(Element e) { a.slideRight(); } }, new Function() { public void f(Element e) { a.animate("left: '+=300', width: 'hide'"); } }, new Function() { public void f(Element e) { a.animate("left: '-=300', width: 'show'"); } }); $("#b2").toggle(new Function() { public void f(Element e) { b.as(Effects.Effects).clipUp(); } }, new Function() { public void f(Element e) { b.as(Effects.Effects).clipDown(); } }, new Function() { public void f(Element e) { b.as(Effects.Effects).clipDisappear(); } }, new Function() { public void f(Element e) { b.as(Effects.Effects).clipAppear(); } }); }
From source file:gwtquery.samples.client.GwtQueryImageZoom.java
License:Apache License
public void onModuleLoad() { // Fancy Thumbnail Hover Effect w/ jQuery - by Soh Tanaka // http://www.sohtanaka.com/web-design/examples/image-zoom/ $("ul.thumb li").hover(new Function() { public void f(Element e) { $(e).css("z-index", "10").find("img").addClass("hover").as(Effects.Effects).stop().animate( "marginTop: '-110px', marginLeft: '-110px', top: '50%', left: '50%', width: '174px', height: '174px', padding: '20px'", 200);/*from w w w . ja v a2 s. c o m*/ } }, new Function() { public void f(Element e) { $(e).css("z-index", "0").find("img").removeClass("hover").as(Effects.Effects).stop().animate( "marginTop: '0', marginLeft: '0', top: '0%', left: '0%', width: '100px', height: '100px', padding: '5px'", 600); } }); }