Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yaleksandr89/f630897c4b105cca6014b4e340458791 to your computer and use it in GitHub Desktop.
Save yaleksandr89/f630897c4b105cca6014b4e340458791 to your computer and use it in GitHub Desktop.
// "Подсвечиваем" выбранный метод доставки (добавляем класс .shipping-method--active)
// #simplecheckout_shipping - ближайщий статический элемент, который не изменяется при выполнение aJax
var activeInputShippingMethod = $('.shipping-method').find('input:checked');
var activeShippingMethod = activeInputShippingMethod.parents('.shipping-method');
activeShippingMethod.toggleClass('shipping-method--active');
$('#simplecheckout_shipping').on('change', '.shipping-method', function () {
function lazySelectActiveItem_ShippingMethod(){
var activeInputShippingMethod = $('.shipping-method').find('input:checked');
var activeShippingMethod = activeInputShippingMethod.parents('.shipping-method');
activeShippingMethod.toggleClass('shipping-method--active');
}
setTimeout(lazySelectActiveItem_ShippingMethod, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment