Code snippet for using jQueryUI dialog is:
$(".upload_photos").bind('click', function (e) {
e.preventDefault();
var dialog = $(this);
dialog.dialog({
width:860,
height:560,
autoOpen: false
});
dialog.dialog('open');
});
HTML markup:
<div class="upload_photos">
<img src="source" />
</div>
When I click on the 'upload_photos' div, the image shows up in the dialog window but disappears from the background page.
How to keep it visible in the background page at the same time?
When the image will appear on the dialog box, I want to appear it in different dimensions (width and height). How to do that?
EDIT:
Clicking on the 'upload_photos' div multiple times creates multiple dialogs. But I want to create no dialog for the later clicks. How to do that?
EDIT2:
I have a button beneath the image of the "upload_photos" div. I make use of clone (var dialog = $(this).clone();). I get that button in that dialog box too. But If i click on the button the tagging starts on the image in the webpage, not on the image of the dialog box.
What is the solution?
EDIT3:
The tagging script with the help of jquery makes selection on the 'upload_photos' div. When it is being cloned to the dialog, then the script still finds the selection in the webpage, not in the dialog box. This might be related (?) with event handling or what? I tried with
var dialog = $(this).clone(true);
but could not solve. How to divert the attention of the jquery selection to the dialog window?
EDIT4"
If I use var dialog = $(this) instead of var dialog = $(this).clone(true); then the tagging takes place on the dialog box, but the image disappears from the webpage.