[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-18 Thread Dan
Thanks Richard, I didn't know that it wanted an entire valid html element. This code works: $(this).append( "" ); $("#" + title).clone().append( "TEST CONTENT" ); but when I replace "TEST CONTENT" with with the edit_accordion class, it doesn't work. I tried it with and without the .html() $(this

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-18 Thread Dan
I've done some more messing around and came up with a solution that worked: $(this).append( "" ); $(".edit_accordion:first").clone().appendTo( $("#" + title) ); Thanks for all the help Jason and Richard. PROBLEM SOLVED!

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-18 Thread Richard D. Worth
Each append call expects an entire valid html element. You need to build up the string, then append it in one go, or create the entire div element ( ... ) then select that div and do a separate append to it for its content. Examples (untested): $(this).append( '' + $(".edit_accordion").html() +

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-18 Thread Dan
I've done a little messing around and have found that something is wrong with: $(this).append( "" ).append( $(".edit_accordion") ).append( "" ); It only inserts the div tag and "skips" or looses the middle append data. The div tag is also converted into a single tag, such as

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-18 Thread Dan
Thanks Jason for the help so far. That solved the problem I was having. I also added ":first" to a couple of things to make it work even better. Now for some reason, the content of the dialog is not being displayed. >From what Firebug is showing, append or dialog has taken the html and messed it

[jQuery] Re: Adding the dialog function dynamically to each li element

2008-06-17 Thread Jason Huck
I think, at a bare minimum, you'll want to change this: var title = $(this h3).val(); ...to this: var title = $('h3', this).text(); ...and this: $(this h3).append... ...to this: $('h3', this).append... I think that'll solve your immediate problem. - jason On Jun 17, 2:37 pm, Dan <[EMA