javascript - Jquery add div to page ontop of everything else with draggable -
i have application attempting extend functionality of it. case html in example must added javascript. requirement when page loaded div added page , become draggable. happens since div added prepend takes space , there 'grey' space when div dragged around.
$('.body').prepend('<div style="height:40px; width 40px; z-index:9; position:relative;" id="draggable" class="ui-widget-content"><p>test</p></div>'); $(function() { $( "#draggable" ).draggable(); });
i guess , need position absolute
position:absolute;
Comments
Post a Comment