This is probably an easy solution, but I'm having trouble moving my brain around it ...
I use the jQuery editing plugin for some divs that will be generated on the fly. It should be simple: click in the newly created div and you can edit the content. I have problems with live ().
Without using live (), it obviously works fine for a static div. Click once, get editable content.
When using the live () function, I need to double-click to edit the content. Then, at any subsequent time, when he clicked, it only takes once. This seems like a focus issue. Perhaps changing the plugin itself will help?
That's what I'm talking about ... http://jsfiddle.net/efflux/62CzU/
This has something to do with the way I call the editinplace () function with live:
$('.editable').live('click',function() {
$('.editable').editInPlace({
callback: function(unused, enteredText) { return enteredText; },
bg_over: "#cff",
field_type: "textarea",
textarea_rows: "5",
textarea_cols: "3",
saving_image: "./images/ajax-loader.gif"
});
});
How to make the edit-in-place plugin function normally on my divs created via js?
Any help would be appreciated!
source
share