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