.css does not update in firefox? works in chrome and safari
Here is a small demo of a iphone like checkbox I want to use in some forms.
the problem is the .css({'background-position-y':'0px'}) or .css('background-position-y', '0px'); won't work in firefox?
- <html>
- <head>
- <style type="text/css">
- ul.check-box li{
- list-style:none inside none;
- v-align: center;
- }
- li.on-off{
- background: url("http://static.blacknight.ie/gibo/images/checkbox_on_off.png") no-repeat scroll 0 -1.7em transparent;
- padding-bottom: 1.7em;
- padding-left:7em;
- width:0em;
- }
- input.icheckbox { display:none; }
- </style>
- <script type="text/javascript" src="http://static.blacknight.ie/gibo/js/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function (){
- $('li.icheckbox').click(function(){
-
- if( $(this).hasClass('on') ) {
- $(this).css('background-position-y', '0px');
- $(this).removeClass('on');
- $(this).children('input[type="checkbox"]').attr('checked', '');
- } else {
- $(this).css('background-position-y', '-27px');
- $(this).addClass('on');
- $(this).children('input[type="checkbox"]').attr('checked', 'checked');
- }
- });
- });
- </script>
- </head>
- <body>
- <ul class="check-box">
- <li id="id_use-maps" class="icheckbox on-off on"><input type="checkbox" class="icheckbox" name="use_maps" checked="checked"/></li>
- </ul>
- </body>
- </html>
here is an all in one html file.
Can anyone spot what I might be doing wrong here?
Niall