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 685589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:56:16+00:00 2026-05-14T01:56:16+00:00

Im using an existing widget from the jquery-ui labs call selectmenu. It has callback

  • 0

Im using an existing widget from the jquery-ui labs call selectmenu. It has callback options for the events close and open. The problem is i need in these event to animate a node that is part of the widget but not what its connected to. In order to do this i need access to this node.

for example if i were to actually modify the widget code itself:

// ... other methods/properties

"open" : function(event){
    // ... the original logic

    // this is my animation
    $(this.list).slideUp('slow'); 

    // this is the orginal call to _trigger
    this._trigger('open', event, $this._uiHash());
},

// ... other methods/properties

However when in the scope of the event handler i attach this is the orginal element i called the widget on. I need the widget instance or specifically the widget instance’s list property.

$('select#custom').selectmenu({
    'open': function(){
       // in this scope `this` is an HTMLSelectElement not the ui widget
     }
});

Whats the best way to go about getting the list property from the widget?

EDIT: note i posted my final solution below. However, i dont like having to go back out to the DOM to get the element, so id still be interested to hear the best practices for overriding/extending an existing widget or specific internals.

  • 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-05-14T01:56:16+00:00Added an answer on May 14, 2026 at 1:56 am

    So in the end it appears that i missed that the list is assing an id based on the name of the plugin and the original element id. so the following works:

    jQuery(function(){
        jQuery('select#custom').selectmenu({
            width: 100, 
            'style': 'dropdown',
            "open": function(e, data){
                var menu = jQuery('ul#'+$(this).attr('id')+'-menu');
                menu.hide().slideDown('slow');
            },
            "close": function(e, data){
                var menu = $('ul#'+jQuery(this).attr('id')+'-menu');
                menu.addClass('ui-selectmenu-open').slideUp('slow', function(){
                    menu.removeClass('ui-selectmenu-open');
                });
    
            },
            "change": function(){window.location = $(this).val();}
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using org.w3c XML API to open an existing XML file. I'm removing some
I have an existing android app. I added a simple widget to it using
I'm playing around with LinqToSQL using an existing multi-lingual database, but I'm running into
I'm trying to insert a column into an existing DataSet using C#. As an
Existing code is using an asp:repeater to build an HTML table. (emphasis on the
When using gtar to add extra files to an existing archive, the loop terminates
I currently have an existing database and I am using the LINQtoSQL generator tool
I'm using Mono with GTK# and am trying to display an existing window as
I'm looking at an existing site and they are using separate databases. The databases
I have an existing site in php running on Apache using the mod_rewrite plug-in.

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.