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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -