The arc90 lab is the playground of arc90 - a New York-based technology and strategic consulting firm. The lab is a place for us to share our ideas, tools and the occasional experiment in web technology. All ideas, experiments and tools are licensed under Creative Commons.
This site is licensed under a Creative Commons Attribution 2.5 License.
Tools
jQuery Reverse Order plugin
Ever want to reverse the order of a group of DOM elements? Or want to give your user the option?
What is this?
jQuery Reverse Order uses jQuery to reverse the order of DOM elements on your page.
How Do I Use It?
To use jQuery Reverse Order on your site or blog, just follow these simple steps:
Download The Code
Click on the icon below to download the source code:
The file, jquery_reverseorder.zip, contains the script, an example page, and the jQuery library. Once downloaded, unzip and upload the script to a relevant location on your hosted site.
Link To The Javascript
Add a link to the jQuery library and to the javascript file in the page(s) you'd like jQuery Reverse Order implemented. Remember to adjust the path to properly point to the location of the javascript file:
A packed version is also included in the .zip called "jquery_reverseorder.packed.js".
Choosing which elements to reverse
Create a collection of DOM elements inside a common parent. Here's an example:
Then add a single line of javascript, referencing the items to be reversed, to reverse the order:
You could also use:
Examples
Here's another example using the native unordered list as a collection:
Then add a single line of javascript to reverse the order:
You can see more examples and uses of jQuery Reverse Order by clicking here.
Supported Browsers
Currently, the jQuery Reverse Order script has been tested and confirmed on the following browsers:
- Internet Explorer 6.0+
- Mozilla Firefox 2.0+
- Apple Safari 2.0+
- Opera Version 9.0
Licensing
This arc90 tool is licensed under the Creative Commons Attribution-Share Alike 3.0 license.
Discuss jQuery Reverse Order
You can send feedback on jQuery Reverse Order at the arc90 blog.