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

  • Home
  • SEARCH
  • 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 8789501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:25:24+00:00 2026-06-13T22:25:24+00:00

I am writing a jquery UI widget that simply wraps the bootstrap popover plugin,

  • 0

I am writing a jquery UI widget that simply wraps the bootstrap popover plugin, In the widget you can pass in the option ‘singular’,
if this is passed in then it should call a function of all other instances of the plugin.

something like

$('#one').myWidget();
$('#two').myWidget();
$('#three').myWidget();
$('#four').myWidget();

$('#one').myWidget('show'); //stuff from widget one is now visible
$('#two').myWidget('show'); //stuff from widget one and two are now visible
$('#three').myWidget('show'); //stuff from widget one, two and three are now visible
$('#two').myWidget('hide'); //stuff from widget one and three are now visible
$('#four').myWidget('show', {singular:true}); //stuff from widget four is now visible

So, I imagine the show function looking like:

show: function(options){
    options = options || {};

    if(options.singular){
        var instances = '????'; // how do I get all instances?
        $.each(instances, function(i, o){
            o.myWidget('hide');
        });
    }

    this.element.popover('show');

}

So, question being, how would I get a reference to all elements that have the myWidget widget on them?

  • 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-13T22:25:26+00:00Added an answer on June 13, 2026 at 10:25 pm

    You can use $(':ui-myWidget') where ui is your widget’s namespace. It is slower than using a class selector like $('.ui-myWidget') so it is still good practice to add the class when your widget gets created.

    jQuery UI does this for all there widgets so you could get each progressbar by either $(':ui-progressbar') or $('.ui-progressbar').

    This blog post explains thin in greater depth.

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

Sidebar

Related Questions

I'm writing a jquery-plugin, that changes a css-value of certain elements on certain user-actions.
I'm writing a jQuery plugin that will need callback functions that are executed, for
I'm writing a JQuery component plugin that requires some minimal default css. (The css
I am writing jquery ajax code to call wcf service. In this case WCf
I am writing a jQuery plugin to simulate an editable div. Here is my
So I'm writing a jQuery plugin to apply retina graphics. I need to select
I am writing a jQuery plugin and I am at the optimization stage. I
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I'm writing a jQuery plugin to render data retrieved from another domain in an
I am writing a third party JQuery widget. I wanted to have a Social

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.