Make the boxes stay still when scrolling down using the scroll bar

点点圈 提交于 2019-12-11 19:11:43

问题


when I click a box, i can drag it around the screen. You can click the folder icon to open up information view, and a scroll bar will appear because there are a lot of text.

Problem: when i use my mouse to scroll the scrollbar, it also drags the boxes as well. How do I make it not move the box when I click the scroll bar to move the bar?

I am using jsPlumb.draggable() to enable dragging.

jsfiddle: http://jsfiddle.net/7PuN3/2/


回答1:


I would stop/start dragging:

$(function(){   
$('#1 .button_wrap').on('click', function(e){
    e.stopPropagation();
    $(".info").html(newHtml).show();
    jsPlumb.setDraggable("1", false)


});});


$(function(){
    $("#1").on("click", ".info .ui-icon-close", function(){
        $(".info").hide();
        jsPlumb.setDraggable("1", true)
    });
});

then in your css add this class, not to let the div fade when dragging is disabled:

.ui-state-disabled{opacity: 1;}



回答2:


Quick look suggests to me, use relative or absolute positioning not fixed on button wrap. On my mobile it seems to work fine though.



来源:https://stackoverflow.com/questions/22535401/make-the-boxes-stay-still-when-scrolling-down-using-the-scroll-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!