Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:08:59+00:00 2026-06-09T12:08:59+00:00

I want to use in GWT a menu widget (tutorial and code is here:

  • 0

I want to use in GWT a menu widget (tutorial and code is here: http://tympanus.net/codrops/2010/07/16/slide-down-box-menu/) that has the javascript code written with jQuery.
The jQuery code seems simple, but i do not have experience with this library, so I would like to know what is the best (fast and simple let’s say) way to use (run) that code in GWT (maybe I’ll use other jQuery widgets as well).

I found a library called gwtquery and if this is the approach to take, any advice or code would be very very useful (in speeding up that code wrapping process ).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:09:00+00:00Added an answer on June 9, 2026 at 12:09 pm

    You can use jQuery with GWT.

    1. The first key is JSNI. JSNI is how you can directly call native JavaScript functions from your GWT/Java class.
    2. The second key is to realize that all the names that have global (window) scope in native JavaScript code are attributes of the $wnd object in JSNI.
    3. Finally, JSNI has a notation the GWT compiler recognizes for calling GWT/Java code from the JavaScript code. This is important because all the “Java” methods are compiled to JavaScript and have auto-generated names in JavaScript. The GWT compiler must insert the correct name into your JavaScript code for it to call the “Java” code.
    4. The GWT APIs give you access to the elements in the DOM. If you create the elements in the page, then the GWT code can access them as elements. Some elements can be “wrapped” as a widget, but some widgets do not support wrapping simple DOM elements.

    Here is a short (untested) example demonstrating how to embed the sample JavaScript code from the slide-down-box-menu website in GWT. This example doesn’t do much GWT<->JSNI/jQuery interaction, but it does integrate the standard jQuery code in a GWT class.

        import com.google.gwt.core.client.EntryPoint;
        public class MyEntryPoint implements EntryPoint
            {
            public void onModuleLoad()
                {
                this.configureMenu();
                }
    
            public static final native void configureMenu()
                /*-{
                $wnd.$(function() {
                        $wnd.$('#sdt_menu > li').bind('mouseenter',function(){
                                var $elem = $wnd.$(this);
                                $elem.find('img')
                                         .stop(true)
                                         .animate({
                                                'width':'170px',
                                                'height':'170px',
                                                'left':'0px'
                                         },400,'easeOutBack')
                                         .andSelf()
                                         .find('.sdt_wrap')
                                         .stop(true)
                                         .animate({'top':'140px'},500,'easeOutBack')
                                         .andSelf()
                                         .find('.sdt_active')
                                         .stop(true)
                                         .animate({'height':'170px'},300,function(){
                                        var $sub_menu = $elem.find('.sdt_box');
                                        if($sub_menu.length){
                                                var left = '170px';
                                                if($elem.parent().children().length == $elem.index()+1)
                                                        left = '-170px';
                                                $sub_menu.show().animate({'left':left},200);
                                        }   
                                });
                        }).bind('mouseleave',function(){
                                var $elem = $wnd.$(this);
                                var $sub_menu = $elem.find('.sdt_box');
                                if($sub_menu.length)
                                        $sub_menu.hide().css('left','0px');
    
                                $elem.find('.sdt_active')
                                         .stop(true)
                                         .animate({'height':'0px'},300)
                                         .andSelf().find('img')
                                         .stop(true)
                                         .animate({
                                                'width':'0px',
                                                'height':'0px',
                                                'left':'85px'},400)
                                         .andSelf()
                                         .find('.sdt_wrap')
                                         .stop(true)
                                         .animate({'top':'25px'},500);
                        });
                });
                }-*/; // end JSNI method
            } // end class
    

    The gwtquery library is not what you are looking for: it is not related to jQuery except for mimicing its API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use a CellTable widget in GWT. I want to change the font size
I want to use the latest gwt-incubator drop - gwt-incubator-july-14-2009.jar - in a Maven
I want to use my own existing model in GWT application. From what I've
I want use this 1 for using Bar code or QR code scanner. I
We use WebSphere 7.x (It supports Java ee 5). We want to use gwt
We are using GWT & GWTP with UiBinder and I want to use properties
Let's say I want to use Google GWT on the client side and Google
I want to use a link or a button like (a href=.../>) in GWT
Why would I want to use java portlets above tomcat and gwt? Would portlets
I am developing a GWT-Spring-Hibernate project and I want to use Spring Autowired annotation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.