简体   繁体   English

在IE8中动态添加div可拖动

[英]Make dynamically added div draggable in IE8

I have function which bind draggable functionality to newly added div. 我有将可拖动功能绑定到新添加的div的功能。

Something like this: 像这样的东西:

function bind_draggable($el){
    $el.draggable({
        //options...
    });
}

var $container = $('#container'),
    $div = $(<some content here>);

$container.append($div);
bind_draggable($div);

It works fine in all browsers but fails in IE8 . 它适用于所有浏览器,但在IE8中失败。 I tried to add ready() handler to $div , but this doesn't help too. 我试图将ready()处理程序添加到$div ,但这也没有帮助。

The reason why draggable doesn't work in IE < 9 is distance: 15 declaration in draggable options. draggable在IE <9中不起作用的原因是distance: 15可拖动选项中的distance: 15声明。 In fact delay option is also incompatible with IE < 9 事实上, delay选项也与IE <9不兼容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM