开发者

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; } } });

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜