<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="treeview.WebForm1" %>
<%--
$(function () {
$(".treeNode").draggable();
$("#<%= TreeView1.ClientID%>").droppable({
drop: function (event, ui) {
alert(event.originalTarget.text);
}
});
});
--%>
#draggable { 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; }
<%--
$( function() {
$("#TreeView1").draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
}
});
} );
--%>
<%--
$(function () {
$(".treeNode").draggable();
$("#<%= TreeView1.ClientID%>").droppable({
drop: function (event, ui) {
alert(event.originalTarget.text);
}
});
});
--%>
$(function () {
$(".draggable").draggable({
revert: true,
helper: 'clone',
start: function (event, ui) {
$(this).fadeTo('fast', 0.5);
},
stop: function (event, ui) {
$(this).fadeTo(0, 1);
}
});
$(".treeNode").draggable();
$("#TextBox1").droppable({
hoverClass: 'active',
drop: function (event, ui) {
this.value = $(ui.draggable).text();
}
});
});
<%--
NodeSpacing="0px" VerticalPadding="2px">--%>
VerticalPadding="0px" />
<%--
--%>
Replies
Know the answer? Post it — somebody with the same question will find it here.