JQuery从jcarousel拖放图像

时间:2012-02-24 13:06:30

标签: jquery asp.net image drag-and-drop jcarousel

我有一个jcarousel,我用listview填充图像如下,whcih工作正常:

<script type="text/javascript">

    jQuery(document).ready(function() {
        jQuery('#mycarousel').jcarousel();

    });

</script>

<div class="slidercontainer">
               <asp:ListView ID="lstImages" runat ="server" >

               <LayoutTemplate>
                <ul id="mycarousel" class="jcarousel-skin-tango">
                <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                </ul>
               </LayoutTemplate>

               <ItemTemplate>
               <li>
               <image src="../Images/<%#Eval("ID") %>/<%#Eval("ImageName") %>"  width="95" height="75" alt="" />
               </li>
               </ItemTemplate>

            <EmptyDataTemplate>
            <div>
            No Images To Display
            </div>
            </EmptyDataTemplate>

               </asp:ListView>

            </div>

如何将这些图像拖放到div中?我搜索过但找不到任何关于它的信息。

我们将不胜感激。

编辑:

我发现这个脚本仅在我删除加载jcarousel的上述脚本时才适用于一个图像:

<script type="text/javascript">

$( init );

function init() {
  $('#makeMeDraggable').draggable();
  $('#makeMeDroppable').droppable( {
    drop: handleDropEvent
  } );
}

function handleDropEvent( event, ui ) {
  var draggable = ui.draggable;
  alert( 'The square with ID "' + draggable.attr('id') + '" was dropped onto me!' );
}

</script>

1 个答案:

答案 0 :(得分:0)

发现这篇伟大的文章正是我想要的:

http://mypaaji.com/Index.php/how-to-create-a-shopping-cart-widget/