I have the following script, which adds some buttons (fake buttons for now) to a div:
$("<div class='divButtons'>").appendTo( $(this).closest(".widget").find(".widget_header") );
// not real buttons, just text at the moment. Trying to get the position right first.
$(".divButtons").text("(close), (min), (max), (help)").css({background:"red",float:"right"});
The problem is, I don’t know how to get the top-right corner of the divButtons to position itself to the top-right corner of the parent .widget_header. I’ve tried adding top:some_number_here, but that doesn’t work to well when moving the div with jQueries ui-sortable.
You don’t have to specify style attributes via javascript, try adding something like this to your .css file: