I'm new to use Jquery ui. I'd like to create a modal dialog box and close it only when I click on the link or image within 开发者_高级运维the modal box.
I found the way to hide close button,but I don't know how set popup close on click or add image with link inside the box.
Can someone provide me full code to obtain this?
If you look at the documentation ( http://docs.jquery.com/UI/Dialog#methods ) you can see there is a close function. When creating the dialog you can attach a click event to any arbitrary element (a new close link/image/button/anything) that calls the close function on that dialog object:
var my_dialog = $('#my_div').dialog({});//options, etc
$('#my_div .my_close_link').click(function () {
my_dialog.close();
});
精彩评论