Finding dialogs without using an id after they have been created

Finding dialogs without using an id after they have been created


Hi Guys :)
I've noticed that in the process of jQuery UI creating and marking up
dialogs
it changes the structure of the document, placing the new dialogs at
the
bottom of the body with the rest of my dialogs, which are pretty much
all the
same, with nothing to distinguish them from each other.
This is giving me grief because I don't use ids on these dialogs...
In the HTML I make the dialog a sibling of the paragraph the dialog
link is in,
and so was hoping to reference the dialog relatively (from the link),
but this is
not possible with the dialog moving.
Any suggestions or ideas? This is what I was hoping to do, which would
allow
me to have a versionDialog and dialogLink pair in many div containers,
with
one piece of code for all the pairs of dialogs and links.
// #results is a div that contains a few containers, each with its own
pair of
// .dialogLink and .versionDialog
$('#results .versionDialog').dialog({
autoOpen: false,
width: 600
});
$('#results .dialogLink').click(function(e){
$(this).parent().parent().find('.versionDialog').dialog('open');
return false;
});
<div id="#results>
<div id="#results-1">
<!-- Version Information -->


Results were produced with version
<a href="#" class="ui-state-default ui-corner-all dialogLink">
<span class="ui-icon ui-icon-newwin"></span>1536
</a>
of the pipeline







<div class="versionDialog" title="Information">


<span>General:</span>
svn info -r 1536 svn+ssh://some.computer/staff/svn/project




</div>
</div>
<div id="#results-2">
<!-- Version Information -->


Results were produced with version
<a href="#" class="ui-state-default ui-corner-all dialogLink">
<span class="ui-icon ui-icon-newwin"></span>1672
</a>
of the pipeline







<div class="versionDialog" title="Information">


<span>General:</span>
svn info -r 1672 svn+ssh://some.computer/staff/svn/project




</div>
</div>
</div>