开发者

Draggable popup with scrollbar issue in jQuery, Chrome

开发者 https://www.devze.com 2023-02-13 17:35 出处:网络
I have created a draggable popup using jQuery that has a scrol开发者_StackOverflow中文版lbar. When I click the

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

精彩评论

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