draggable

Drag and Drop between different layout units in Primefaces

自古美人都是妖i 提交于 2019-12-12 20:13:36
问题 I have 4 layout units in full-page Primefaces layout. I have outputlabel in west layout unit. I want to drag it and drop it to center layout-unit. The drop area which I want to drop output label to here is a panel in tabView. When I start the dragging outputLabel don't go out from west layout-unit. Also when I drag it to out of west layout-unit it disappears. How can I solve my problem? I've been working on it for 2 days but I haven't succeed. Here is my code: <!DOCTYPE HTML PUBLIC "-//W3C/

jQuery draggable('cancel') causing error: this.helper is null

断了今生、忘了曾经 提交于 2019-12-12 17:29:37
问题 I've got a jQuery draggable() slider that I want to cancel at a certain event, however this causes the error: 'this.helper is null'. The code is simply: $( '#magicalscrollhandle' ).draggable( 'cancel' ); Any ideas? 回答1: "cancel" isn't actually a valid method on the draggable widget. The best way I've come across to cancel a drag event is to return false from the drag event handler. You could do this based on some condition that you set based on your event occurring: $("#draggable").draggable(

Show custom image when drag an element in jquery

蓝咒 提交于 2019-12-12 17:08:46
问题 I'm using JQuery UI for drag and drop tree nodes and its working fine. I need to improvise it in terms of much more user interactive, When i drag any element it shows the same element name, you can see in the image (Test 3 I've dragged to down). But my requirement is when I drag any tree node it should show the image specified, instead of same text. Is it possible? My draggable function as follows, what changes i need to do to achieve the requirement. $("li a").draggable({ revert: "invalid",

jQuery: Finish dragging without triggering click event

怎甘沉沦 提交于 2019-12-12 16:17:56
问题 I am trying to set up the following page where: If you click the button, you can see a div. If you click the div, you can see the next div. If you move the button, there is no »click« (desired behaviour) The problem I am having is that if you move the div, the next div appears - this is not what I want. The "next div" should not be displayed after a drag event finishes on it. Here is my code: $(function() { $("#button").draggable({ stack: 'div', containment: "body" }); }); $('#button').on(

Draggable View not moving, calls ACTION_DOWN then directly to ACTION_CANCEL

萝らか妹 提交于 2019-12-12 13:13:33
问题 I have a custom view which can be dragged by touch here's the complete code. package com.neibrapp.neibr; import android.app.ActionBar; import android.content.ClipData; import android.content.Context; import android.gesture.Gesture; import android.gesture.GestureLibraries; import android.gesture.GestureOverlayView; import android.gesture.GestureUtils; import android.graphics.drawable.GradientDrawable; import android.support.v4.view.GestureDetectorCompat; import android.util.Log; import android

Restrict drag only in one direction

試著忘記壹切 提交于 2019-12-12 10:47:54
问题 Using jQuery Draggable How to restrict a draggable to be dragged only in one direction ? i.e either only top or only bottom when axis: 'y' and either only left or only right when axis: 'x' This means that if I want a draggable (with axis set to 'y') to be dragged only to bottom , then it should not be able to drag it to top i.e it should remain in its place when tried to drag towards top This is what I have tried but not working, i.e draggable is still getting dragged in upward direction $('.

Jquery Drag and drop not working in Firefox, works fine in chrome and safari

时间秒杀一切 提交于 2019-12-12 10:25:54
问题 Jquery Drag and drop not working in Firefox and IE, but works fine in chrome and safari. This is my code: $(".drag").draggable({ helper: "clone", }); $(".drop").droppable({ drop: function (ev, ui) { if ($(ev.toElement).hasClass("drop") == true) { var widgetId = $(ui.draggable).attr("id"); $(ev.toElement).attr("id", "dash_" + widgetId); $(ev.toElement).html($(ui.draggable).html()); } } }); Code uploaded at http://www.skmcap63.hostoi.com/box-dashboard/ I need to drag the items from sidebar and

Control draggable movement in jQuery

柔情痞子 提交于 2019-12-12 09:43:23
问题 how can I control de movement of a draggable in jquery? I need to do something similar to the "snap to grid" where the draggable moves every "x" and "y" pixels I can't use "grid: [x, y]" (2D) because I need to make the drag on an isometric grid (3D) (I will develop the grid later, I first need to controll the drag) for example: when I start the dragging, the draggable shouldn't move, it has to snap to another position when the "x" and "y" are under certain conditions thanks in advance! 回答1:

dragging from a sortable list to a drag and drop plugin

亡梦爱人 提交于 2019-12-12 09:20:10
问题 I am trying to allow dragging from a sortable list to a dynatree. My initial though was to specify something like this: $('#ews_pgs_clpbrd_items').sortable({ connectToDynatree: true }).disableSelection(); dynatree does not register the drag and drop events for the sortable items. so I tried $("#ews_pgs_clpbrd_items").sortable().disableSelection(); $("#ews_pgs_clpbrd_items li").draggable({ connectToDynatree: true, connectToSortable: "#ews_pgs_clpbrd_items" }); This allows the items in the

How can I drag a piece of user generated text around the HTML5 canvas?

南楼画角 提交于 2019-12-12 08:08:48
问题 Basically what I have coded is the ability to type a word into a text box. When a button is pressed to submit it that word is then posted to the HTML5 canvas so people can see it. What I want to do now is to have the ability to drag that word around the HTML5 canvas. I'm having slightly difficulty in achieving this and was wondering if someone could help me with this please? Here's my code what I've done so far: var fname; var canvas; var ctx; var canvasX; var canvasY; var mouseIsDown;