Draggable popup with scrollbar issue in jQuery, Chrome
I have created a draggable popup using jQuery that has a scrol开发者_StackOverflow中文版lbar. When I click the scrollbar using Chrome, it moves with the mouse pointer and can not be released until I right click.
For the draggable popup, I am using jQuery, e.g.:
$("#id").draggable();
This works in other browsers.
Not 100% what causes this, might be chrome's scrollbars rendering as html.
I'm afraid you'll need to initialize a draggable with the handle option specified.
$( "#id" ).draggable({ handle: '.yourhandleclass' });
It might also be possible to use the 'Cancel' option specified. (Prevents dragging from starting on specified elements.)
Like this:
$( "#id" ).draggable({ cancel: '.replacethiswithchromescrollbarselector' });
Answer from :Ticket #4441
Code Sample:
var drag = c.draggable({
start: function(event, ui) {
var t = event.target;
if (event.pageX > t.offsetWidth + t.offsetLeft){
return false;
}
}
});
精彩评论