Sorry about that the .exists()
function is a jquery plugin that I regularly use for checking if an element is on page or not. Super Useful.
// Tiny jQuery Plugin
// by Chris Goodchild
$.fn.exists = function(callback) {
var args = [].slice.call(arguments, 1);
if (this.length) {
callback.call(this, args);
}
return this;
};
As for using the .each()
function, extremely smart thing to do. I don’t know why that slipped my mind to check for each instance of the element. Worked like a charm!