Easily toggle a loading class on an element.