jquery-ui-sortable

jQuery Masonry and UI Sortable

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 10:15:35
问题 There's this website I'm developing which can be found here. It's a photography website and my client asked for me to implement something that would allow her to move the photos around and change the order of which they appear. They come from a MySQL database and are displayed with jQuery Masonry. I thought instantly of jQuery UI Sortable, and I've been trying to implement it with absolutely no luck at all. How can I achieve this? Can someone point me in the right direction, please? Thanks in

Jquery draggable/droppable and sortable combined

一世执手 提交于 2020-01-02 02:41:08
问题 I was asked to create a grid of squares, where each square may or may not contain a link and these links should be able to be moved about the grid. I figured that draggable/droppable would be the way to go and it works fine, however, now we want to be able to have the draggables swap about if one is dropped on top of another. So it looks now like sortable would have been the way to go. However, sortable looks more like it's meant for lists whereas I haven't written it like a list. Is there an

Sortable clone helper not working

筅森魡賤 提交于 2020-01-02 01:08:21
问题 Maybe I don't understand how clone works with sortable, but here is what I would like to do. When sorting an item I would like a clone of the item I am dragging remain until I stop drop the item in its new position. Here's the code: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script> <style type="text/css">

A container that is sortable, droppable and draggable

倾然丶 夕夏残阳落幕 提交于 2020-01-01 17:27:28
问题 This question related to jQuery's UI. Can anybody provide an example the does the following: Container A is sortable and droppable Any element can be dragged into Container A and then sorted. Any element can be dragged out of Container A and then simply become draggable around the page. Container A is also draggable around the page This is what I have so far: $(function() { $("#sortable").sortable().droppable(); $("#sortable").disableSelection(); $("#drop").droppable({ accept: "#sortable li",

A container that is sortable, droppable and draggable

时光毁灭记忆、已成空白 提交于 2020-01-01 17:27:08
问题 This question related to jQuery's UI. Can anybody provide an example the does the following: Container A is sortable and droppable Any element can be dragged into Container A and then sorted. Any element can be dragged out of Container A and then simply become draggable around the page. Container A is also draggable around the page This is what I have so far: $(function() { $("#sortable").sortable().droppable(); $("#sortable").disableSelection(); $("#drop").droppable({ accept: "#sortable li",

jQuery-UI Draggable and Sortable

本秂侑毒 提交于 2020-01-01 15:41:03
问题 So I've been working with this example: http://jqueryui.com/demos/draggable/#sortable and I've accomplished it on my product. However I want to make two significant changes. I don't want the second list(toList in my example) to be sortable on it's own. I only want it to accept items from the first list(fromList in my example). When a user drags an item from the first list(fromList) and drops it into the second list(toList) I want that item to be forced to the bottom. Suggestions? Here is a

jQuery-UI Draggable and Sortable

杀马特。学长 韩版系。学妹 提交于 2020-01-01 15:40:57
问题 So I've been working with this example: http://jqueryui.com/demos/draggable/#sortable and I've accomplished it on my product. However I want to make two significant changes. I don't want the second list(toList in my example) to be sortable on it's own. I only want it to accept items from the first list(fromList in my example). When a user drags an item from the first list(fromList) and drops it into the second list(toList) I want that item to be forced to the bottom. Suggestions? Here is a

Does jQuery always iterate through DOMs in order in which they are found in the code?

独自空忆成欢 提交于 2020-01-01 08:02:50
问题 Say, for example, I have a sortable list: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> What I want to know is, if I make a jQuery call such as the following: $.each($('li'), function(key, item) {...}); Can I expect jQuery to go through the entries from top to bottom? I've run a few tests, and tried rearranging items dynamically using jQueryUI, and so far, it seems to always run in order. But can this always be expected? Or is it dumb luck that I've not run into anything so far

Sort vector of objects for binary search

北战南征 提交于 2020-01-01 06:55:21
问题 I have the following class: struct EdgeExtended { int neighborNodeId; int weight; int arrayPointer; bool isCrossEdge; }; I want to have a vector of such objects, sort it by neighborNodeId. Then I want to search for a particular neighborNodeId and return a reference to the found object inside the vector by binary search. Previously I used a map for that, so it was something like that: map<int, EdgeExtended> neighbours; ..... auto it = neighbours.find(dnodeId); if (it != neighbours.end()) {

Sort vector of objects for binary search

[亡魂溺海] 提交于 2020-01-01 06:55:05
问题 I have the following class: struct EdgeExtended { int neighborNodeId; int weight; int arrayPointer; bool isCrossEdge; }; I want to have a vector of such objects, sort it by neighborNodeId. Then I want to search for a particular neighborNodeId and return a reference to the found object inside the vector by binary search. Previously I used a map for that, so it was something like that: map<int, EdgeExtended> neighbours; ..... auto it = neighbours.find(dnodeId); if (it != neighbours.end()) {