Draggable containment document problem with margin left jquery ui 1.5

Draggable containment document problem with margin left jquery ui 1.5


Hallo all.
I have a problem with a draggable div created with the containment
option set to document.
The relative css for the div is
.divclass {
top:50%;
left:50%;
height:300px;
width:600px;
margin-left:-300px;
margin-top:-150px;
}
The properties margin-left and margin-top seem to make some problems
with the containment option on the left side and on the top side:
infact with these properties is possible to drag the div out of the
screen on the left (for the 50% of his width) and out of the screen on
the top (for the 50% of his height).
Any suggestion to correct this strange behaviour?
Kind regards
Massimo