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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -