Change Each order of my plugin? $("#id3,#id1,#lid2).myPlugin()
in Developing jQuery Plugins
•
5 years ago
Hi guys,
I've wrote a plugin - and it works great for what I need - except I've noticed today that:
- return this.each(function() {
Puts the elements in the order they appear in the DOM.
So on my html page, I have this...
- <div id="id1"></div>
<div id="id2"></div>
<div id="id3"></div>
But I want to change the divs in the order I provide the plugin. Like this...
- $("#id3,#id1,#lid2).myPlugin()
The each function changes the order to how the elements appear on the page - 1,2,3 But this is no good.
Please can someone explain how I can make the plugin do its thing in the order I enter the elements
Thanks for the help!
1