开发者

How to get html of en element and add to a td element

开发者 https://www.devze.com 2023-02-27 10:00 出处:网络
I am using jquery to do drag and drop. I am able to do drag and drop. My dragged element is an image. Now, I want to show this image on target which is a table cell(td). Ho开发者_如何学Pythonw to do t

I am using jquery to do drag and drop. I am able to do drag and drop. My dragged element is an image. Now, I want to show this image on target which is a table cell(td). Ho开发者_如何学Pythonw to do this?

$(".emptyimg").draggable();
$("#tdcell").droppable({
  drop: function(event, ui ) {$(ui.draggable).??;}

});

thanks


Check the following code:

    <style>
#draggable { width: 150px; height: 150px; padding: 0.5em; }
</style>
<script>
    $(function () {
        $("#draggable").draggable();
    });
</script>



<div class="demo">
<script type="text/javascript"
        src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript"
        src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
<div id="draggable" class="ui-widget-content" style="cursor:move">
    <p>Drag me around</p>
</div>

</div><!-- End demo -->
0

精彩评论

暂无评论...
验证码 换一张
取 消