draggable

jQuery UI Draggable not dragging from the correct place

强颜欢笑 提交于 2019-12-11 17:13:56
问题 When I grab my draggable(s), they seem to snap incorrectly to the grid on the right - this has me confused! Any idea how I can drag an element and have it snap closer to my cursor?? code: <html> <head> <title></title> <script type="text/javascript" language="javascript" src="sys/jquery-1.4.2.js"></script> <script type="text/javascript" language="javascript" src="sys/jquery-ui-1.8.4.min.js"></script> <style type="text/css"> * { font-family: arial; font-size: 11px; margin: 0; padding: 0; } div

Jquery Live and Draggable

空扰寡人 提交于 2019-12-11 16:57:09
问题 I am binding a click event to an image using Jquery Live binding. The first time I click on the image the simplemodal popup launches and draggable works fine. After that, the simplemodal popup still launches and the draggable item will not drag. Any ideas? Code of Live Click Event: $("table tr td img:not(.Help)").live("click", function(){ $("#draggable").draggable({ containment: 'parent', drag: function(e, ui){ alert("dragging"); } }); $("#modal").modal({ onShow: function(){ $("html").css(

JQUERY-UI Draggable with asynchronous selectors

萝らか妹 提交于 2019-12-11 16:25:13
问题 Is it possible to use JQUERY-UI draggable with elements that are imported asynchronously using jquery's .load function? I guess that I would need to use .on or .bind, but can't figure out something that works... 回答1: I would just use the .load callback to assign the draggable property: $("#containerselector").load('path', function () { $(this).find( "elementsthatshouldbedraggableselector" ).draggable(); }); 来源: https://stackoverflow.com/questions/15629185/jquery-ui-draggable-with-asynchronous

how drag and drop component as first word

[亡魂溺海] 提交于 2019-12-11 14:16:19
问题 I'm using jQuery UI draggable component to add to content editable .This code works to find and I have a little issue. The problem is I cannot drag and drop draggable component as first word, How can I solve this? Please help me to solve this. Note : the current functionlity cannot be break. My code as follows: $(function() { function textWrapper(str, sp, btn) { if (sp == undefined) { sp = [0, 0]; } var txt = ""; if (btn) { txt = "<span class='w b'>" + str + "</span>"; } else { txt = "<span

Silverlight 4: why items are not moveable?

大城市里の小女人 提交于 2019-12-11 11:34:44
问题 There is a "field" on which some items are draggable: Here is a XAML code: <Canvas Height="180" Width="169" > <Image Canvas.Left="0" Canvas.Top="0" Height="180" Width="149" Source="../Picts/field.png" /> <Pages:FieldItem x:Name="Item2" Canvas.Left="129" Canvas.Top="34" MouseLeftButtonDown="Item1_OnMouseLeftButtonDown" MouseLeftButtonUp="Item1_MouseLeftButtonUp" MouseMove="Item1_MouseMove" /> </Canvas> And code-behind: private bool bIsCaptured = false; double mouseVerticalPosition; double

Draggable object “glued” to border

雨燕双飞 提交于 2019-12-11 10:44:07
问题 I've created a user control that includes a label inside a draggable div, like this: <style type="text/css"> .text_label { margin-top:8px; font-size:18px; color:#545454; -moz-border-radius: 2px; -webkit-border-radius: 2px; -border-radius: 2px; } .clear { clear:both; height:20px; } .drag { display:block; } </style> <div class="drag"> <asp:Label ID="lbl1" class="text_label" runat="server" Text="Click Me"/> </div> <div class="clear"></div> For draggable I'm using the following option in the

Draggable element inside another draggable element

為{幸葍}努か 提交于 2019-12-11 09:48:32
问题 Here in the fiddle is more less what i want to do: http://jsfiddle.net/EUZS5/2/ . I have different elements in a swiper and in some slides inside there is a draggable element. Currently when i drag the arrow it also pulls the slide (which is not the behaviour i want:)) I tried to use 'stopPropagation' on drag event but it does not help to prevent the slide from moving. Any ideas how to achieve this? Im using hammerjs and idangerous.swiper. $(document).ready(function(){ var mySwiper = new

jQuery UI Sortable + Dragable - Prevent items from “source” list from being dropped twice on “target” list

喜欢而已 提交于 2019-12-11 09:34:21
问题 I am using a combination of sortable and dragable on a "widget-style" set of lists. I have my "available" list of items in a draggable list that is connected to 7 "target" lists (which are sortable). The available list has the clone helper to make sure the available list always stays populated with the available items. This all works beautifully, with one exception. Once an item has been dragged and dropped from the available column to a target column, I do not want it to be draggable onto

Best solution for drag/drop category/subcategory? Tried jQuery UI sortable, now stuck

本小妞迷上赌 提交于 2019-12-11 08:33:38
问题 I have a very crude category list right now, but I'm wanting it to make it look and behave more like WordPress admin does it, where you can drag a category into another category. Code looks like this: <ul class="categories"> <li>Real Estate</li> <li>Home Improvements</li> <ul class="categories"> <li>Interior</li> <li>Exterior</li> <ul class="categories"> <li>Exterior Subcat</li> </ul> </ul> </ul> I tried jQuery UI's sortable, and told it to sort <li> 's only, but the list items wouldn't drag

replaceWith and jQuery draggable drop?

我只是一个虾纸丫 提交于 2019-12-11 07:47:38
问题 I'm trying to understand why $('#title').replaceWith('ha'); will work outside the drop: function(event, ui) {} area in jquery's droppable script, but it won't work inside. Specifically, if I do $(".droppable").droppable({ drop: function(event, ui) { $('#title').replaceWith('ha'); } I get a Runtime Error (line 1102) data(...).options is null or not an object . Also if I insert a $('#title').append('ha'); inside the drop:, it works. However if I put $('#title').replaceWith('ha'); anywhere else