Drag & Drop using accordion panels (VB / ASP)

I have an accordion control in ASP 3.5, with multiple accordion panels. For the sake of simplicity, I will focus on only one panel as the issue is area specific. Using JQuery I created a drag and drop function and applied it to my .drag cssclass. In Page_Load I create a bunch of image objects and assign this class to them in addition to the image. Once I load the page, I can drag and drop all the images around as intended. However, what I cannot do is drag these images outside of the accordion panel in which they were created! Is there a way to get around this? I tried using this but to no avail:

 <script type="text/javascript">
    $(function() {
    $(".drag").draggable({ containment: 'document' });
    });
</script>

      

Is there something on the real aspx page that I should be focusing on? I add images to a panel in the accordion panel 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!

0


a source to share


2 answers


All I had to do was add a clone helper, then whatever I drag and drop can get out of its parent container. This is how I update my dragline and it now works:

 $('.drag').draggable({ revert: true,helper: 'clone' });}

      



Now for life I can't figure out the bit :)

0


a source


Have you tested this in multiple browsers? Sounds like an IE problem to me. Perhaps adding a large Z-index value to your .drag class in CSS will help.



0


a source







All Articles