I've been looking for a way to allow a user to select one or more elements of my page and freely drag them at one time. I found a couple examples, one of which is this one. This would work as I want, with a few modifications. My only issue is that it was written about 3 years ago and it doesn't seem to function with the current versions of jQuery and jQuery UI.
If anyone can point me to an updated version or another example that works with today's libraries, I would appreciate that.
I'm trying to understand how I might toggle on/off functionality while a key is pressed. I've been working on an example but I'm struggling with how to select the element I'm currently interacting with so I can revert functionality once the key is released.
Below is the code I'm currently working on. On lines 6, 16 and 17 I would really like to select the specific element that was being resized, not all items in that class. How can I reference that specific item to toggle it's settings?
I'm trying to create a tool where I could drag a child div from one parent to another.
A few of the conditions that I want to point out is in the source parent, I want to use "overflow: auto" in my css so that I can scroll the items if there are too many available.
The second thing I want to achieve is when I drop the item into the destination parent, I want the item to land where I drop it and still be draggable to any location in the new parent.
So far it's doing everything I want, except for the fact that it's positioning the items relative to the other elements in the destination parent instead of letting them be placed where they are dropped.
Any help on how I can solve this would be greatly appreciated!
I'm working on a page where I'd like to have multiple accordions or datepickers. I understand that I can add the following code multiple times to my page and change the selector to the ID of the item I want to work with.
<script>
$(function() {
$( "#accordion" ).accordion({
collapsible: true,
active: false
});
});
</script>
What I would like to do, and what seems more natural to me, is I would like have that code only once with a variable for the id that I can pass in with all the different items I want to work on. It seems because of the way the function/selector works, I can't make it function more generically since there isn't really a call such as "onclick" on the div itself.
Is there anyway to simplify the function so i don't have to have 30 of them if I want say, 30 accordions on my page?