Package com.google.gwt.query.client

Examples of com.google.gwt.query.client.Function


public class GwtQueryImageZoom implements EntryPoint {

  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);
      }} , 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);
    }});
View Full Code Here


  public void onModuleLoad() {
    //Hide the text and set the width and append an h1 element
    $("#text").hide().css(CSS.WIDTH.with(Length.px(400))).prepend("<h1>GwtQuery Rocks !</h1>");

    //add a click handler on the button
    $("button").click(new Function(){

      public void f() {
        //display the text with effects and animate its background color
        $("#text").as(Effects)
            .clipDown(1000)
View Full Code Here

  public void onModuleLoad() {

    // FadeIn sample
    $("#fadeIn div.foo").hide();
    $("#fadeIn > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#fadeIn div.foo").as(Effects).fadeIn(2000);
      }
    });

    $("#fadeIn > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#fadeIn div.foo").hide();
      }
    });


    // FadeOut sample
    $("#fadeOut > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#fadeOut div.foo").as(Effects).fadeOut(2000);
      }
    });

    $("#fadeOut > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideRight div.foo").hide();
      }
    });

// FadeToogle sample
    $("#fadeToogle > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#fadeToogle div.foo").as(Effects).fadeToggle(2000);
      }
    });


//Toogle sample
  $("#toogle > button").click(new Function() {
    @Override
    public void f(Element e) {
      $("#toogle div.foo").as(Effects).toggle(2000);
    }
  });
View Full Code Here

    slides.hide().eq(0).as(Effects).clipAppear();
    $(s.allSlideBullets()).hide();


    // add onclick handler to body element
    $(slides).click(new Function() {
      // two state variables to note current slide being shown
      // and current bullet
      int curSlide = 0;
      int curBullets = 0;

      // query and store all bullets of current slide
      GQuery bullets = $(s.slideBulletsCtx(slides.get(curSlide)));

      public boolean f(Event e) {
        // onclick, if not all bullets shown, show a bullet and increment
        if (curBullets < bullets.size()) {
          bullets.eq(curBullets++).as(Effects).fadeIn(Speed.SLOW);
        } else {
          // all bullets shown, hide them and current slide
          bullets.hide();

          // move to next slide, checking for wrap around
          int lastSlide = curSlide++;
          if (curSlide == slides.size()) {
            curSlide = 0;
          }

          // query for new set of bullets, and show next slide
          curBullets = 0;
          bullets = $(s.slideBulletsCtx(slides.get(curSlide)));

          // Hide the last slide and show the next when the effects finishes
          slides.eq(lastSlide).as(Effects).fadeOut(new Function() {
            public void f(Element e) {
              slides.eq(curSlide).as(Effects).clipAppear();
            }
          });
        }
View Full Code Here

public class ColorEffectsSample implements EntryPoint {

  public void onModuleLoad() {

    $("#shoot").click(new Function() {

      public void f() {
        $("body").animate("backgroundColor: 'red'", 400)
          .delay(1000)
          .animate("backgroundColor: 'white'", 2000);
      }

    });

    $("#startAnim2").click(new Function(){

      public void f() {
        $(".bar").animate("backgroundColor: 'yellow'", 1000)
          .delay(200)
          .animate("borderColor: '#ff0000'",1000)
          .delay(200)
          .animate("color:'rgb(255, 255, 255)'", 1000);
      }

    });

    $("#resetAnim2").click(new Function(){

      public void f() {
        $(".bar").css(CSS.BACKGROUND_COLOR.with(null), CSS.BORDER_COLOR.with(null), CSS.COLOR.with(null));
      }
View Full Code Here

public class SlideEffectsSample implements EntryPoint {

  public void onModuleLoad() {

    // SlideUp sample
    $("#slideUp > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideUp div.foo").as(Effects).slideUp();
      }
    });

    $("#slideUp > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideUp div.foo").show();
      }
    });

    // SlideDown sample
    $("#slideDown div.foo").hide();
    $("#slideDown > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideDown div.foo").as(Effects).slideDown();
      }
    });

    $("#slideDown > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideDown div.foo").hide();
      }
    });

    // SlideToogle sample
    $("#slideToogle > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideToogle div.foo").as(Effects).slideToggle(400);
      }
    });

    // SlideLeft sample
    $("#slideLeft > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideLeft div.foo").as(Effects).slideLeft();
      }
    });

    $("#slideLeft > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideLeft div.foo").show();
      }
    });


    // SlideRight sample
    $("#slideRight div.foo").hide();
    $("#slideRight > button").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideRight div.foo").as(Effects).slideRight();
      }
    });

    $("#slideRight > button.reset").click(new Function() {
      @Override
      public void f(Element e) {
        $("#slideRight div.foo").hide();
      }
    });
View Full Code Here

  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;
      }
    });
    $(".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();
      }
    });
View Full Code Here

  public void iframeReadyCallback() {
    writeTestContent($(".ibench").contents().find("body").get(0));
    gwtiframe = $(".ibench").eq(0).contents().get(0);
    $("#startrace").text("Start the race");
    $("#startrace").click(ask ? askBenchMarks: runBenchMarks);
    $("#about").click(new Function(){
      public void f() {
        helpPanel.center();
      }
    });
  }
View Full Code Here

  public void onModuleLoad() {
    doMoveAnimation();
    doColorAnimation();

    $("#stopMove").click(new Function(){
      public void f() {
        $(".foo").clearQueue().stop();

      }
    });

    $("#stopColor").click(new Function(){
      public void f() {
        $(".foo").clearQueue("colorQueue");
      }
    });

    $("#startMove").click(new Function(){
      public void f() {
        $(".foo").css(CSS.LEFT.with(Length.px(0)));
        doMoveAnimation();
      }
    });

    $("#startColor").click(new Function(){
      public void f() {
        doColorAnimation();
      }
    });
View Full Code Here

    $(".foo")
      .queue("colorQueue", lazy().css(CSS.BACKGROUND_COLOR.with(RGBColor.RED)).dequeue("colorQueue").done())
      .delay(500, "colorQueue")
      .queue("colorQueue", lazy().css(CSS.BACKGROUND_COLOR.with(RGBColor.BLACK)).dequeue("colorQueue").done())
      .delay(500, "colorQueue")
      .queue("colorQueue", new Function() {
            @Override
            public void f() {
              doColorAnimation();
              $(".foo").dequeue("colorQueue");
            }
View Full Code Here

TOP

Related Classes of com.google.gwt.query.client.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.