javascript - jQuery Draggable - Getting out of containment - Chrome Bug -
i realized there bug jquery draggable in chrome, doesn't exist in firefox , internet explorer. have div #drag-container /450x80/ , 3 draggable objects inside. /150x0/ , when move them lowest point ,let them , drag again lower position 0,80 + 14 = 0,94 px. let them , drag , 14 px lower again.
is there fix ?
working demo: http://jsfiddle.net/ucmqq/ here code:
<style> .draggable { width: 150px; height: 0px; cursor:move; } <?php if($userinfo->use_colors != '0'): ?> #drag-container { width: 450px; height:80px; background-color:<?=$userinfo->background?>; } <?php else: ?> #drag-container { width: 450px; height:80px; background:url(/backgrounds/<?=$userinfo->image?>); } <?php endif; ?> </style> <script language="javascript"> $(function() { $( "#draggable" ).draggable({ cursor: "move",containment: 'parent', scroll: false, stop: function() { document.settings.np_x.value = $(this).css('left'); document.settings.np_y.value = $(this).css('top'); } }); $( "#draggable2" ).draggable({ cursor: "move",containment: 'parent', scroll: false , stop: function() { document.settings.artist_x.value = $(this).css('left'); document.settings.artist_y.value = $(this).css('top'); } }); $( "#draggable3" ).draggable({ cursor: "move",containment: 'parent', scroll: false , stop: function() { document.settings.other_x.value = $(this).css('left'); document.settings.other_y.value = $(this).css('top'); } }); }); </script> <div id="drag-container"> <div id="draggable" class="draggable" style="position:relative;top:5px;left:80px;"> .::[ nowplaying signature ]::. </div> <div id="draggable2" class="draggable" style="position:relative;top:25px;left:80px;"> artist - title </div> <div id="draggable3" class="draggable" style="position:relative;top:45px;left:80px;"> album: (year) <br> genre: </div> </div>
the problem height of draggable object 0. height 1 again it's buggy, without height @ it's ok.
Comments
Post a Comment