I'm working on a simple jQuery switch button. The kind you mostly see on mobile.
[ on | off ]
I have the below snippet that I found in a jsfiddle. But it won't work; I tried wrapping it in -
$('.slider-button').toggle(function(){
$(this).addClass('on').html('Quizz');
},function(){
$(this).removeClass('on').html('Read');
});
})
I tried wrapping it in a on ready as well.
$(document).ready(function(){
$('.slider-button').toggle(function(){
$(this).addClass('on').html('Quizz');
},function(){
$(this).removeClass('on').html('Read');
});
})
I'm loading the latest in jQuery:
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
Mark-Up:
<div class="slider-frame">
<span class="slider-button">OFF</span>
</div>
It simply wont toggle onClick.
Edit: Here's an attempt at a fiddle; http://jsfiddle.net/Hn27Q/
Still can't get it; and actually none of the CSS3 is being seen at mobile; any suggestions appreciated.
- Bill