Ok, so I searched the documents and came across the children & sibling
functions.
Tried something like this:
$(function() {

        var options = {
                autoOpen: false,
                show: 'blind',
                hide: 'fold',
                width: 800,
                modal: true
        };

        $(".links-players").siblings().each(function() {
                var num = this;
                var dlg = $('#dialog-player-' + num).dialog(options);
                $('#link-player-' + num).click(function() {
                        dlg.dialog("open");
                        return false;
                });
        });
});

This does not work either.
Can anyone help me out here pls.

On Aug 15, 12:56 pm, moleculezz <[email protected]> wrote:
> Hello all,
>
> I'm pretty new with jquery and I looked for information and I found
> some code that works for static amount of modal boxes. But now I want
> it to be dynamic.
> Static Method:
> $(function() {
>         var options = {
>                 autoOpen: false,
>                 width: 'auto',
>                 modal: true
>         };
>         $([1, 2, 3]).each(function() {
>                 var num = this;
>                 var dlg = $('#dialog-player-' + num).dialog(options);
>                 $('#player-link-' + num).click(function() {
>                         dlg.dialog("open");
>                         return false;
>                 });
>         });
>
> });
>
> Dynamic Method:
> $(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;
>                 });
>         });
>
> });
>
> I looked at this page of the documentation:http://docs.jquery.com/Core/each
> What I tried is to select all divs in container "div#parent". But that
> didn't work. Anybody know of any other way to do this ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to