拖放 涉及手风琴窗格的放置 (VB/ASP)
我在 ASP 3.5 中有一个手风琴控件,带有多个手风琴窗格。 为了简单起见,我将只关注一个窗格,因为问题是特定于窗格的。 使用 JQuery,我创建了一个可拖动函数并将其应用到我的 .drag CSS 类。 在 Page_Load 上,除了图像之外,我还创建了一堆图像对象并将该类分配给它们。 加载页面后,我可以按预期拖动所有图像。 然而,我不能做的是将这些图像拖到创建它们的手风琴面板之外! 有办法解决这个问题吗? 我尝试使用这个,但没有效果:
<script type="text/javascript">
$(function () {
$(".drag").draggable({ containment: 'document' });
});
</script>
实际的 aspx 页面中是否有我应该关注的内容? 我正在将图像添加到手风琴窗格中的面板中,它看起来像这样:
<ajaxToolkit:AccordionPane id="AccordionPane1" runat="server">
<Header> Chassis</Header>
<Content>
<asp:Panel ID="ChassisPanel" runat="server">
</asp:Panel>
</Content>
</ajaxToolkit:AccordionPane>
我感谢任何指导!
I have an accordion control in ASP 3.5, with multiple accordion panes. For the sake of simplicity, I will only focus on one pane as the problem is pane specific. Using JQuery, I created a draggable function and applied it to my .drag CSS class. On Page_Load, I create a bunch of image objects and assign that class to them, in addition to an image. Once I load the page, I can drag all the images around as intended. What I can't do, however, is drag those images outside of the accordion panel they were created in! Is there a way around that? I tried using this, but to no avail:
<script type="text/javascript">
$(function () {
$(".drag").draggable({ containment: 'document' });
});
</script>
Is there something in the actual aspx page that I should be focusing on? I'm adding the images to a panel in my accordion pane, and it looks like this:
<ajaxToolkit:AccordionPane id="AccordionPane1" runat="server">
<Header> Chassis</Header>
<Content>
<asp:Panel ID="ChassisPanel" runat="server">
</asp:Panel>
</Content>
</ajaxToolkit:AccordionPane>
I appreciate any guidance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你在多个浏览器中测试过这个吗? 对我来说听起来像是 IE 遇到的问题。 也许在 CSS 中的 .drag 类中添加一个大的 Z-Index 值会有所帮助。
Have you tested this in multiple browsers? Sounds to me like an issue I had with IE. Perhaps adding a large Z-Index value to your .drag class in CSS would help.
我所要做的就是添加克隆助手,然后我拖动的任何东西都可以逃脱其父容器。 这就是我更新拖线的方法,现在它可以工作了:
现在我一生都无法弄清楚可放下的位:)
All I had to do was add the clone helper, then anything I drag is able escape its parent container. This is how I updated my drag line and now it works:
Now for the life I me I can't figure out the droppable bit :)