I have a drag drop elements facility. I want to add a div before any element, after it is dropped to the page. Is it possible ? I tried to do it using live, but number divs it adds are strange. For first time, it add one or two and second time. it adds more than two. I'm trying this :
$('#PageContent > .textElementClass').live('dblclick', function(e) {
ElementWidth=$(e.target).width();
targetElement=$(e.target);
$(e.target).css({'display':'none'});
$(e.target).before('<div id="TextValue" style="'+ElementWidth+'"><textarea cols="50" rows="10">Edit Content</textarea><input type="button" value="Save" class="SaveContent"></div>');
$('.SaveContent').live('click', function(e){
firstChild=$('#TextValue > textarea').html();
$(targetElement).html(firstChild);
$(targetElement).css({'display':'block'});
$('#TextValue').remove();
});
});