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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:05:38+00:00 2026-05-12T09:05:38+00:00

So I have like a list of users on a page. each user name

  • 0

So I have like a list of users on a page. each user name is clickable and it displays the user information in the dialog. Right now I’m using a static length for the list.
I would like jquery to see how big the list of users is and apply the code to the list.

Check out the code here:

$(function() {
    var options = {
            autoOpen: false,
            width: 'auto',
            modal: true
    };
    $([1, 2, 3, 4]).each(function() {
            var num = this;
            var dlg = $('#dialog-player-' + num).dialog(options);
            $('#player-link-' + num).click(function() {
                    dlg.dialog("open");
                    return false;
            });
    });

});

I looked at this page of the documentation: each
What I tried is to select all divs in container “div#parent”. Like so:

$(function() {
    var options = {
            autoOpen: false,
            width: 'auto',
            modal: true
    };
    $("div#parent div").each(function() {
            var num = this;
            var dlg = $('#dialog-player-' + num).dialog(options);
            $('#player-link-' + num).click(function() {
                    dlg.dialog("open");
                    return false;
            });
    });

});

But that didn’t work. Anybody know of any other way to do this ?

  • 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-12T09:05:38+00:00Added an answer on May 12, 2026 at 9:05 am

    I’ve noticed a bug in your code and fixed it for you:

    $(function() {
        var options = {
                autoOpen: false,
                width: 'auto',
                modal: true
        };
        var num = 1;
        $("div#parent div").each(function() {
                var dlg = $('#dialog-player-' + num).dialog(options);
                $('#player-link-' + num).click(function() {
                        dlg.dialog("open");
                        return false;
                });
                num = num + 1;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of users on my php application (using codeigniter). Each user
I have a jsp page which iterates a list of users. Each user has
I have a list like this: <select name=select_list_name id=list_id> <option value=>Select Option</option> <option value=value1>Option
I have a list like myl = ['A','B','C','D','E','F'] #length always even Now my desired
I have a page where I display a list of threads for a user
i have a drop down list contains the name of reports and each report
We have a SharePoint solution that uses a standard task list. We would like
I have a list like: list = [[1,2,3],[4,5,6],[7,8,9]] I want to append a number
Have dict like: mydict= {'a':[],'b':[],'c':[],'d':[]} list like: log = [['a',917],['b', 312],['c',303],['d',212],['a',215],['b',212].['c',213],['d',202]] How do i
Say I have a List like: List<String> list = new ArrayList<>(); list.add(a); list.add(h); list.add(f);

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.