aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorRay Cromwell <cromwellian@gmail.com>2009-05-07 07:43:31 +0000
committerRay Cromwell <cromwellian@gmail.com>2009-05-07 07:43:31 +0000
commit0ed7f3c4acaa7575a37894d7106238d0cef742ab (patch)
tree094eba6b18c0802490defc341db3bc1e29908fae /samples
parent503766b707d661aff81957e0f860d854bb608fda (diff)
downloadgwtquery-0ed7f3c4acaa7575a37894d7106238d0cef742ab.tar.gz
gwtquery-0ed7f3c4acaa7575a37894d7106238d0cef742ab.zip
Misc fixes. Sample animation.
Diffstat (limited to 'samples')
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java53
1 files changed, 26 insertions, 27 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
index 74a137b7..cd9c3247 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
@@ -1,17 +1,13 @@
package gwtquery.samples.client;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.query.client.$;
-import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.Effects;
+import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
-import com.google.gwt.query.client.css.CSS;
import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.GQuery.$$;
import static com.google.gwt.query.client.GQuery.lazy;
-import static com.google.gwt.query.client.css.CSS.*;
-import static com.google.gwt.query.client.css.Length.*;
-import static com.google.gwt.query.client.css.Percentage.*;
-import static com.google.gwt.query.client.css.RGBColor.*;
+import com.google.gwt.user.client.Event;
/**
* Copyright 2007 Timepedia.org Licensed under the Apache License, Version 2.0
@@ -34,27 +30,30 @@ public class GwtQuerySampleModule implements EntryPoint {
public void onModuleLoad() {
GQuery q = $(".note");
- q.setCss(CSS.BACKGROUND_COLOR, CSS.RED);
- q.setCss(TEXT_ALIGN, LEFT);
- q.setCss(VERTICAL_ALIGN, px(10));
- $("div > div").hover(lazy().
- css("color", "red").
- done(), lazy().
+ $("div > div").
css("color", "blue").
- done());
-
-// $(".note").dblclick(
-// lazy().as(Effects.Effects).
-// fadeOut().
-// done());
-// $("div.outer").dblclick(new Function() {
-// @Override
-// public boolean f(Event e, Object data) {
-// $(e.getCurrentTarget()).as(Effects.Effects).slideUp();
-// return true;
-// }
-// });
-// $("div").wrapAll("<table border=2><tr><td></td></tr></table>");
+ hover(
+ lazy().
+ css("color", "red").
+ done(),
+ lazy().
+ css("color", "blue").
+ done());
+ $("div.outer > div").css("position", "relative").dblclick(new Function() {
+ public boolean f(Event e) {
+ $("div.outer > div").as(Effects.Effects).
+ animate($$("left: '+=100'"), 400, Effects.Easing.LINEAR, null).
+ animate($$("top: '+=100'"), 400, Effects.Easing.LINEAR, null).
+ animate($$("left: '-=100'"), 400, Effects.Easing.LINEAR, null).
+ animate($$("top: '-=100'"), 400, Effects.Easing.LINEAR, null);
+
+ return true;
+ }
+ });
+ $(".note").click(lazy().fadeOut().done());
+ $(".note").append(" Hello");
+
+
}
}