Skip to content

Instantly share code, notes, and snippets.

@zapatoche
Created October 16, 2014 15:21
Show Gist options
  • Save zapatoche/85941d8a0bb64eeeb0d6 to your computer and use it in GitHub Desktop.
Save zapatoche/85941d8a0bb64eeeb0d6 to your computer and use it in GitHub Desktop.
$(function(){
if ($('body').hasClass('mp-2376')) {
$('.mp-2376').unbind('click');
}
//only apply the bellow functionality to nodes with the following body class: mobile-optimisation
if ($('body').hasClass('mobile-optimisation')) {
$('.form-radios .form-item').click(function(){
$(this).addClass("checked").siblings('.form-item').removeClass('checked');
});
$('.form-checkboxes .form-item').click(function(){
if( $(event.target).is("label") ) {
if ($(this).hasClass('checked')) {
$(this).removeClass('checked');
}
else {
$(this).addClass('checked');
}
}
});
$('#edit-continue').click(function(){
window.scrollTo(0, 0);
});
//$('#edit-submitted-primary-address-postalcode').attr('type', 'tel');
$('#edit-submitted-primary-address-postalcode').replaceWith($('#edit-submitted-primary-address-postalcode').clone().attr('type', 'tel'));
$('#edit-submitted-telephone-number').replaceWith($('#edit-submitted-telephone-number').clone().attr('type', 'tel'));
$('#edit-submitted-email1').replaceWith($('#edit-submitted-email1').clone().attr('type', 'email'));
}
// end
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment