Droppable区域不会沿div容器移动(drop_receiving_element)

时间:2016-02-19 13:53:28

标签: ruby-on-rails

我使用“draggable_element”来拖动项目,使用“drop_receiving_element”作为可投放容器。但由于视图上的图像数量,我的页面有点长。

当我从页面底部拖动图像并将其移动到可放置区域时,它不会在那里掉落并恢复到实际位置。当我将拖动图像移动到可放置区域下方一定距离时,它会突出显示可放置区域。所以我认为可放置区域是固定在窗口,因为它不随容器一起移动。这是我的代码。

<%= draggable_element "#{property.main_image.dom_id('main')}", :revert => true %>
<div id="img_<%= property.main_image.id %>" style="display: none"><%= image_tag property.main_image.image_url(600), :onload => 'RedBox.setWindowPosition()' %></div>


<div id="images_wastebin" class="wastebin">
 <p>Remove images by dragging them into the trashcan, and emptying it.</p>
 <img id="images_trashcan_empty" src="/images/gui/trashcan_empty.png" />
 <img id="images_trashcan_full" src="/images/gui/trashcan_full.png" style="display:none"></div>
<%= drop_receiving_element "images_wastebin", :accept => "droppable", :hoverclass => "wastebin-active", :before => "imagesTrashcan.addToTrash(element)" %>

任何人都可以帮助我,谢谢

0 个答案:

没有答案