Flip Switch - is it possible to detect changes as they happen (onchange)?

Flip Switch - is it possible to detect changes as they happen (onchange)?

Hi guys,

I have spent hours on this and got nowhere so I'm assuming it's not yet possible to detect when a flip switch is changed?

I'm using this kind of code:

<div data-role="fieldcontain">
   <label for="audioOn">Play Audio:</label>
      <select name="audioOn" id="audioOn" data-role="slider">
      <option value="off">Off</option>
      <option value="on">On</option>
       </select> 
</div>

Now I can bind an onchange event to the select element and it works but, it seems to fire many times during the transition animation and sometimes will continue to fire unless I move the mouse away from the element. The onchange event seems broken.

I have also tried binding a click event to the anchor that JQM creates for the slider but while this works, it ONLY works when clicking on the state I want to change to (e.g. On or Off). If I click on the already selected part of the flip switch, the switch toggles state but the anchor event is not fired. It appears that the hit area of the anchor is only around the non-selected state.

So I can get this to work partially, but it's not complete as the user can click on the already selected part of the switch (causing the state to toggle) and I am not informed of the change.

Is there something simple I'm overlooking here?

I just want to detect when a flip switch changes state just as I would be able to do with a normal select element using onchange..

Thanks in advance - this is melting my brain. :)