Jquery Toggle two function not work in jquery 1.10.1 but work\'s on Jquery 1.8.3
HTML
For example, consider the HTML:
Here is a generic method, with multiple functions to toggle:
var toggleFunctions = [
function () { /* do something */},
function () { /* do something else */},
...
function () { /* do some other stuff*/}
];
$("#target").on("click", function(){
// returns first function from array
var currentFunction = toggleFunctions.shift();
// executes the function
currentFunction();
// pushes current function to the back
toggleFunctions [] = currentFunction;
});