Skip to content

Instantly share code, notes, and snippets.

@Itachicz11
Created June 22, 2012 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Itachicz11/2973599 to your computer and use it in GitHub Desktop.
Save Itachicz11/2973599 to your computer and use it in GitHub Desktop.
Here is myjs.js file
if($('#iph_check').next().attr('checked')){
$('#iph_check').iphoneSwitch("on",
function() {
if($('#iph_check').next().attr('checked')){
//then checked attribute exist so modify it!
$('#iph_check').next().prop('checked', !$checkbox[0].checked);
}else{
$('#iph_check').next().attr('checked', true);
}
},
function() {
$('#iph_check').next().attr('checked', false);
},
{
switch_on_container_path: 'iphone_switch_container_off.png'
});
}else{
$('#iph_check').iphoneSwitch("off",
function() {
if($('#iph_check').next().attr('checked')){
//then checked attribute exist so modify it!
$('#iph_check').next().prop('checked', !$checkbox[0].checked);
}else{
$('#iph_check').next().attr('checked', true);
}
},
function() {
$('#iph_check').next().attr('checked', false);
},
{
switch_on_container_path: 'iphone_switch_container_off.png'
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment