Example #1
0
        static Events()
        {
            jQuery.OnDocumentReady(delegate()
            {
                jQueryObject start_counter = jQuery.Select("#event-start");
                jQueryObject drag_counter = jQuery.Select("#event-drag");
                jQueryObject stop_counter = jQuery.Select("#event-stop");
                int[] counts = new int[] { 0, 0, 0 };

                DraggableOptions options = new DraggableOptions();
                options.Start = delegate(jQueryEvent e, DragStartEvent eventData)
                {
                    counts[0]++;
                    UpdateCounterStatus(start_counter, counts[0]);
                };
                options.Drag = delegate(jQueryEvent e, DragEvent eventData)
                {
                    counts[1]++;
                    UpdateCounterStatus(drag_counter, counts[1]);
                };
                options.Stop = delegate(jQueryEvent e, DragStopEvent eventData)
                {
                    counts[2]++;
                    UpdateCounterStatus(stop_counter, counts[2]);
                };

                jQuery.Select("#draggableEvents")
                    .Plugin<DraggableObject>()
                    .Draggable(options);

            });
        }
        static VisualFeedback()
        {
            jQuery.OnDocumentReady(delegate()
            {
                jQuery.Select("#draggableVisual1")
                      .Plugin<DraggableObject>()
                      .Draggable(new DraggableOptions("helper", "original"));

                jQuery.Select("#draggableVisual2")
                      .Plugin<DraggableObject>()
                      .Draggable(new DraggableOptions("opacity", 0.7f
                                                     , "helper", "clone"));

                DraggableOptions options = new DraggableOptions();
                options.Cursor = "move";
                options.CursorAt = new Dictionary("top", -12, "left", -20);
                options.Helper = new Func<jQueryEvent, jQueryObject>(delegate(jQueryEvent e)
                {
                    return jQuery.FromHtml("<div class='ui-widget-header'>I'm a custom helper</div>");
                });

                jQuery.Select("#draggableVisual3")
                      .Plugin<DraggableObject>()
                      .Draggable(options);

                jQuery.Select("#draggableVisualSet div")
                      .Plugin<DraggableObject>()
                      .Draggable(new DraggableOptions("stack", "#draggableVisualSet div"));
            });
        }
 public extern DraggableObject Draggable(DraggableOptions options);