Check the box to toggle the display of the page element (IE7 problems!)

When users check the box "My delivery address and billing address are the same," I want to hide the delivery address form.

This code works well in everything except IE:

$("#order_shipping_same_as_billing").change(function() { 
  $("fieldset.shipping").toggle("blind", { 'direction' : 'vertical' }, 50);
});

IE does not register a change event until the flag loses focus , which creates an unpleasant user experience.

Many trading sites (and not trading platforms!) Do such things - there should be a cross-browser compatible method that I miss.

+3
source share
2 answers

click . , IE.

$("#order_shipping_same_as_billing").click(function() { 
  $("fieldset.shipping").toggle("blind", { 'direction' : 'vertical' }, 50);
});
+4

click . , , .

+2

Source: https://habr.com/ru/post/1709953/


All Articles