You can use the metadata plugin (
http://plugins.jquery.com/project/metadata) to store and retreive the
values like so:
<a href="http://some/url/to/open/in/dialog"; class="DialogEdit
{width:500,height:250}">link text</a>

Then something like this should do:

$('.DialogEdit').click(function() {
  var options = $(this).metadata("DialogEdit");
  $('<div></div>').load(this.href, function() {
    $(this).dialog(options);
  });
  return false;
});

- Richard

On Wed, Oct 7, 2009 at 7:59 PM, Patrick <pwc1...@gmail.com> wrote:

>
> I'd like to be able to set the size of a jQuery dialog dynamically
> when I call it based on the target to be shown. I was considering
> adding invalid attributes like the following... where edit_width and
> edit_height are parsed and passed right before opening the dialog.
>
> <a href="HTMLToOpenInDialog" class="DialogEdit" edit_width=500
> edit_height=250>
>
> But it's probably not be the best way. The dialog call is done from a
> base page, while the actual content to call is determine from the link
> clicked on the widget. When setting the link, I would know the size
> needed for the HTMLToOpenInDialog... Any ideas that don't use non-
> standard markup or hidden fields?
>
> Thanks,
> Patrick

Reply via email to