Today I needed some JS-Code for toggling an DOM elements attribute. Because there is no such feature in the jQuery core, I implemented it. Perhaps it’s useful for you, so here it is :)
At the moment, I improve my ApToggleSwitch plugin and stumbled over a problem which leads to a nice jQuery function I want to share. Perhaps this code can be useful for you!
The problem was that I have to copy a special event from one html element to another – in my case I only wanted the
change event to be copied. I found some posts how to copy events, but the solutions did not work
perfectly, so I had to merge the solutions presented in
Last month I searched for a nice component to improve checkboxes. Checkboxes are okay but I think that a toggle switch is a nicer representation of the TRUE/FALSE status. Furthermore on touch devices checkboxes are sometimes too small, so users really have to aim to click the control.