Jquery拖放ASP.Net [英] Jquery Drag and Drop ASP.Net

查看:67
本文介绍了Jquery拖放ASP.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我似乎无法在html表格中找到选择作为我的dropzone的元素。



这是我目前的代码



My issue is that i cannot seem to find the element to choose as my dropzone within an html table.

Here is my current code

<script type="text/javascript">
    $(document).ready(function () {
        $("#dragdiv").draggable({ revert: true })
        //var toDrag = $('#droptable tr td');
        $('#dropdiv').droppable({
            drop: function () {
                //$('#dragdiv').hide("explode", { pieces: 64 }, 2000);
                $('#dragdiv').hide("Transfer");
                document.getElementById('<%=hiddenButton.ClientID%>').click(); return false;
            }
        });
    });
</script>





和我的html表格:





And My html table:

<div id="dropdiv" class="myclass">
            <table cellpadding="0" cellspacing="0" class="auto-style2" id="droptable">
                <tr id="drop_tr">
                    <td><asp:Image ID="Image3" runat="server" ImageUrl="~/img/notStartedBasket.png" /></td>
                    <td rowspan="3" valign="top" width="100%">
                 </tr>
            </table>
</div>







It是这样的,但我想做的是将dropdiv放在第一个

这样的地方。






It works like this, but what i would like to do is put the "dropdiv" around the first

like this.

<td id="dropdiv"><asp:Image ID="Image3"  runat="server" ImageUrl="~/img/notStartedBasket.png" /></td>





然后使用我的jquery来调用我的dropzone,但由于某种原因,如果div标签在表m内y jquery似乎不起作用。



任何帮助都非常感谢!



And then use my jquery to call that my dropzone, but for some reason if the div tag is within the table my jquery doesn't seem to work.

Any help is highly appreciated!

推荐答案

document )。ready( function ( ){
(document).ready(function () {


#dragdiv)。draggable( {revert: true })
// var toDrag =
("#dragdiv").draggable({ revert: true }) //var toDrag =


('#droptable tr td');
('#droptable tr td');


这篇关于Jquery拖放ASP.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆