繁体   English   中英

jQuery Draggable-脱离控制-Chrome错误

[英]jQuery Draggable - Getting out of containment - Chrome Bug

我意识到我在Chrome中存在jQuery Draggable的错误,而在Firefox和Internet Explorer中不存在。 我有div#drag-container / 450x80 /​​和3个可拖动对象。 / 150x0 /,当我将它们移到最低点时,将它们放下再向下拖动,它们的位置为0,80 + 14 = 0,94 px。 我让它们拖动,它们又降低了14像素。

有修复程序吗?

工作演示: http : //jsfiddle.net/ucmqq/这是代码:

<style>
    .draggable { width: 150px; height: 0px; cursor:move; }
    <?PHP if($userinfo->use_colors != '0'): ?>
    #drag-container { width: 450px; height:80px; background-color:<?=$userinfo->background?>; }
    <?PHP else: ?>
    #drag-container { width: 450px; height:80px; background:url(/backgrounds/<?=$userinfo->image?>); }
    <?PHP endif; ?>
    </style>

    <script language="javascript">

    $(function() {
        $( "#draggable" ).draggable({ cursor: "move",containment: 'parent', scroll: false,
        stop: function() {
        document.settings.np_x.value = $(this).css('left');
        document.settings.np_y.value = $(this).css('top');
         }
                                    });
        $( "#draggable2" ).draggable({ cursor: "move",containment: 'parent', scroll: false ,
        stop: function() {
        document.settings.artist_x.value = $(this).css('left');
        document.settings.artist_y.value = $(this).css('top');
         }
                                     });
        $( "#draggable3" ).draggable({ cursor: "move",containment: 'parent', scroll: false ,
        stop: function() {
        document.settings.other_x.value = $(this).css('left');
        document.settings.other_y.value = $(this).css('top');
         }
                                     });
    });

    </script>


<div id="drag-container">
    <div id="draggable" class="draggable" style="position:relative;top:5px;left:80px;">
        .::[ NowPlaying SIGnature ]::.
    </div>
    <div id="draggable2" class="draggable" style="position:relative;top:25px;left:80px;">
        Artist - title
    </div>
    <div id="draggable3" class="draggable" style="position:relative;top:45px;left:80px;">
        Album: (Year)
        <br>
        Genre:
    </div>

</div>

问题在于可拖动对象的高度为0。再次将高度设置为1时,它是越野车,但是完全没有高度就可以了。

我有相同的错误,但就我而言,没有可拖动元素的高度。 就我而言,我使用了引导程序,并且尝试将元素拖到不同的col-md-3 div中。 问题出在col-md-3的css float属性中。 所以我不得不将其删除,并使用display: inline-block; vertical-align: top; display: inline-block; vertical-align: top;

也许会帮助某人。

暂无
暂无

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

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