Hi All, I'm new member in this mailing list.
I have problem with jquery,
I have code like this

<!DOCTYPE HTML>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">


    <title>jQuery UI Droppable - Revert draggable position</title>
    <link type="text/css" href="revert_files/ui.css" rel="stylesheet">
    <script type="text/javascript"
src="revert_files/jquery-1.3.2.js"></script>
    <script type="text/javascript" src="revert_files/ui.js"></script>
    <script type="text/javascript"
src="revert_files/ui.draggable-1.7.2.js"></script>
    <script type="text/javascript"
src="revert_files/ui.droppable-1.7.2.js"></script>
    <link type="text/css" href="revert_files/demos.css" rel="stylesheet">
<style type="text/css">
    #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em;
float: left; margin: 10px 10px 10px 0; }
    #droppable { width: 150px; height: 150px; padding: 0.5em; float: left;
margin: 10px; }
    </style>
    <script type="text/javascript">
    $(function() {

        $("#draggable").draggable({helper: 'clone'});
        $("#draggable2").draggable({helper: 'clone'});

        $("#droppable").droppable({
            accept: "#draggable, #draggable2",
            activeClass: 'droppable-active',
            hoverClass: 'droppable-hover',
            drop: function(event, ui) {

                var lid = ($(ui.draggable).children("p"));
                alert(lid);
                var removeLink = document.createElement("a");
                removeLink.innerHTML = "remove";
                removeLink.href = "#";
                removeLink.onclick = function()
                {
                    $("#droppable").children('p').remove("#"+lid[0].id);
                    $(this).remove();
                }


$(this).append($(ui.draggable).clone().children("p").addClass("blocker"));
                $(this).append(removeLink);
            }
        });

    });
    </script>

</head><body style="cursor: auto;">
<div class="demo">

<div id="draggable" class="ui-widget-content">
    <p>I revert when I'm dropped</p>
</div>

<div id="draggable2" class="ui-widget-content">
    <p>I revert when I'm dropped</p>
</div>

<div id="droppable" class="ui-widget-header">
    <p>Drop me here</p>
</div>

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

<div class="demo-description">

<p>Return the draggable (or it's helper) to its original location when
dragging stops with the boolean <code>revert</code> option set on the
draggable.</p>

</div><!-- End demo-description -->
</body></html>


and if click remove, jquery just remove a link remove not tag <p>
please help me.

-- 
Regards,
Muhammad Imam
Blog : http://waterbomm.web.id/blog
Y!M : imam26_it

Reply via email to