This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Swap two elements within a multiple selector with index a and b | |
* @param a: index of the first element | |
* @param b: index of the second elemnt | |
* | |
* DEMO at http://jsfiddle.net/derekhu/8rauhuxh/#base | |
*/ | |
function swapElement(elements, indexA, indexB) { | |
// Make sure indexA is smaller than indexB | |
if (indexA > indexB) { |