javascript - Draggable with ghosting in jquery-ui not working in IE8/9 -
javascript - Draggable with ghosting in jquery-ui not working in IE8/9 -
starting generating draggable box, , handle @ top using jquery-ui draggable().
however, sometime content within of box can flash , tends cause dragging function move slowly. decided move ghosting type scheme drag , shows box moving it, , moves location drop this.
i have gotten running in chrome/firefox, cannot run in either ie8 or ie9. wondering if had suggestions. below jquery specific code.
$(document).ready(function () { $container = $('#container'); $container.draggable({ handle: "#header", containment: "parent", scroll: false, helper: function () { homecoming "<div class='dragbox' style='width:" + ($container.width()) + "px;height:" + ($container.height()) + "px'></div>"; }, stop: function (e, ui) { var top = ui.position.top, left = ui.position.left; $container.css({ 'top': top + "px", 'left': left + "px" }); } }); });
example can found @ http://jsfiddle.net/ep5wu/.
thanks in advance!
the argument 'ui' in drag stop event element dragged , not the 'helper' div (green box) .. need top/left values of 'helper' after drag stops.
try ..works in ie10
$(document).ready(function () { $container = $('#container'); $container.draggable( { handle: "#header", scroll: false, helper:function () { homecoming "<div class='dragbox' style='width:" + ($container.width()) + "px;height:" + ($container.height()) + "px'></div>"; }, stop: function (e, ui) { console.log(ui.helper); var top = $(ui.helper).offset().top; var left = $(ui.helper).offset().left; $container.css({ 'top': top + "px", 'left': left + "px" }); } }); });
fiddle here : http://jsfiddle.net/ep5wu/16/
javascript jquery jquery-ui internet-explorer
Comments
Post a Comment