问题描述:

Basically I want to use jQuery ui dialog everywhere in same page,how could i use this?

I wrote following code and and I need to customize things that are par needed

 $( "#dialog-confirm" ).dialog({

resizable: false,

height:140,

modal: true,

autoOpen: false,

buttons: {

"Okay": function() {

$( this ).dialog( "close" );

return true;

},

Cancel: function() {

$( this ).dialog( "close" );

return false;

}

}

});


$('.trashImage').live('click', function (event) {

some value= "Item0289478"

// Open DialogBox and pass some value to show user that, you are going to delete this

if it is true

{

// go to delete

}

else

{

back.....to page

}

});

How could I do that, I have many different events in same page.

网友答案:
function reuse(divId)
{
  $( "#"+divId ).dialog({
}

whenever you need to show jQuery dialogbox then simply pass the id dynamically.

相关阅读:
Top