#7368 closed enhancement (invalid)
Set index with index(number)
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | core | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
It would be nice if the index() method allowed you to set the index of the current element(s) also; currently you can only get the index of the first element relative to its siblings. index(0) would move all the elements before their siblings and index(-1) would move all elements after their siblings. And it would be even better if it wrapped, so that if there's three elements and you did index(3), it would place the element at the start.
Change History (5)
comment:1 Changed 12 years ago by
Owner: | set to anonymous |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Component: | unfiled → core |
---|
comment:3 Changed 12 years ago by
Status: | pending → new |
---|
Here's a simple example with jsFiddle of how you could use this to easily be able to move elements with a couple of controls. http://jsfiddle.net/Pzpzr/
I will work on additional usage examples soon if this one isn't sufficient enough.
Thanks!
comment:4 Changed 12 years ago by
Status: | new → pending |
---|
You can already do this very easily using .next
, .previous
, .after
, and .before
, as per this example. Could you please provide a novel use case?
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Automatically closed due to 14 days of inactivity.
Thanks for taking the time to contribute to the jQuery project! Please provide a jsFiddle that outlines practical use cases for your enhancement request.
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists. Be Excellent to eachother!