dialog has a setter option for title, it isn't really a title
attiribute. The dialog "title is actually a span with class
ui-dialog-title-dialog http://jqueryui.com/demos/dialog/#option-title
$(".button").click(function(event){ ui-dialog-title-dialog
').text($(this).attr("id")); constructor must be separate as Mike pointed out Mean Mike wrote: Yes that is correct you need to separate the dialog from the openlike this note: I set the autoOpen to false. [code] $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $('#dialog').dialog('open'); }); $("#dialog").dialog({ autoOpen:false, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); [/code] let me know how that works out for you Mean Mike On Jul 16, 8:31 am, Carlo Landmeter <clandme...@gmail.com> wrote:Hi, I have probably a simple question which i cannot seem to find the answer to. I have a series of images which i want to use as buttons to trigger a dialog. Inside this dialog i need the ID of the image button (or any other element). But it seems after I load the dialog i cannot alter the content of it anymore. As an example I have tried to change the title of the #dialog so it will show the updated title when i click the button. The only way i am able to do this is when i put all of this inside the .click function and start with .attr function followed by the .dialog function. The problem is when i do this and close the dialog i cannot enable the dialog anymore. I guess this is why they have the .dialog("open"). Is there a way i can achieve what I'm trying to do here? Maybe there is a better way of doing this? Tia, Carlo code: $(document).ready(function(){ $(".button").click(function(event){ $("#dialog").attr("title", event.target.id); $("#dialog").dialog({ autoOpen:true, modal:true, overlay: {backgroundColor: "#000",opacity: 0.5}, resizable:false, buttons:{ "Delete": function() {}, "Cancel": function() {$(this).dialog("close");} } }); }); }); <div id="dialog" title="i did not change">this is a test</div> |
- [jQuery] jquery ui dialog get element from button Carlo Landmeter
- [jQuery] Re: jquery ui dialog get element from button Mean Mike
- [jQuery] Re: jquery ui dialog get element from bu... Charlie
- [jQuery] Re: jquery ui dialog get element fro... Mean Mike
- [jQuery] Re: jquery ui dialog get element fro... Carlo Landmeter
- [jQuery] Re: jquery ui dialog get element... Charlie
- [jQuery] Re: jquery ui dialog get el... Carlo Landmeter
- [jQuery] Re: jquery ui dialog ge... Mean Mike
- [jQuery] Re: jquery ui dialo... Carlo Landmeter
- [jQuery] Re: jquery ui dialo... Mean Mike
- [jQuery] Re: jquery ui dialo... Carlo Landmeter
- [jQuery] Re: jquery ui dialo... Mean Mike
- [jQuery] Re: jquery ui dialo... Carlo Landmeter