首页 > 解决方案 > 第一次在引导模式中拖放位置问题,用于 ui 可排序

问题描述

我面临第一次执行的事件的拖放问题。当我第一次将图像拖放到另一个地方时,该问题与图像的位置有关。

问题如下所示。 在此处输入图像描述

这是代码:

$(document).on("click", ".make_pdf", function(){
    var url = $(this).attr('url');        
    $('.modal-body').html('Loading...');
    $('.modal-body').load(url,function(result){
        $('#make-pdf').modal({show:true});
        $( this ).children('.user-settings').children('.pdf-list').children('#sortable').sortable();
        $( this ).children('.user-settings').children('.pdf-list').children('#sortable').disableSelection();
    });
});

了解更多信息。这种拖放在没有模态的情况下也能正常工作,所以请你帮忙用引导模态解决这个问题吗?

这里js小提琴链接。 https://jsfiddle.net/zrLv0ogj/11/ 请增加jsfiddle中输出窗口的高度和宽度。

Jsfiddle 图片链接。 http://prntscr.com/kp1axw

标签: jquerybootstrap-modaljquery-ui-sortable

解决方案


这对我有用。

$(document)
  .on('mouseup', function() {
    $('.modal').css('overflow', '');
  })
  .on('mousedown', '.ui-sortable-handle', function() {
    $('.modal').css('overflow', 'hidden');
  });

推荐阅读