diff options
Diffstat (limited to 'samples/src')
-rw-r--r-- | samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java | 50 | ||||
-rw-r--r-- | samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html | 10 |
2 files changed, 41 insertions, 19 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java index f86fa89b..74a137b7 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java @@ -2,12 +2,16 @@ package gwtquery.samples.client; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.query.client.$;
-import com.google.gwt.query.client.GQuery;
-import com.google.gwt.query.client.Widgets;
import com.google.gwt.query.client.Function;
-import static com.google.gwt.query.client.Widgets.*;
-import static com.google.gwt.query.client.$.$;
-import com.google.gwt.user.client.Event;
+import com.google.gwt.query.client.Effects;
+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.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.*;
/**
* Copyright 2007 Timepedia.org Licensed under the Apache License, Version 2.0
@@ -29,20 +33,28 @@ public class GwtQuerySampleModule implements EntryPoint { // }
public void onModuleLoad() {
- $("div").hover(
- $.lazy().
- css("color", "red").
- done(),
- $.lazy().
- css("color", "blue").
- done());
-
- $(".note").dblclick(
- $.lazy().
- fadeOut().
- done());
- $("div").wrapAll("<table border=2><tr><td></td></tr></table>").fadeOut(10000);
- }
+ 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().
+ 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>");
+ }
}
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html b/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html index a2ab635c..b15701a7 100644 --- a/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html +++ b/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html @@ -4,7 +4,17 @@ <script language="javascript" src="gwtquery.samples.GwtQuerySample.nocache.js"></script>
</head>
<body>
+<div class="outer">
<div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+
+</div>
</body>
</html>
\ No newline at end of file |