Wednesday 15 August 2012

javascript - Clicking checkbox to expand div, doesn't work in IE7 -


The following code works fine in FF, but not IE 7 - when you click on the checkbox in IE divs Do not toggle.

How can I troubleshoot these types of issues - how can anyone know about this?

  // hide divs $ ('optional-toggle1'). CSS ({Display: 'None'}); $ ('Product-Optional-Toggle 2'). CSS ({display: 'none'}); $ ('Product-Optional-Toggle 3'). CSS ({Display: 'None'}); // (Toggle Divis) checkbox $ ('Product-Optional-Checkbox 1'). Change (function () {if ($ (this) .attr ("checked") === "true") {$ ('.product-optional-toggle1') Toggle ('sharp'); return;} $ ('Product-Optional-Toggle 1') Toggle ('Sharp');}); $ ('Product-Optional-Checkbox2'). Change (function () {if ($ (this) .attr ("checked") === "true") {$ ('product-optional-toggle2'). Toggle ('sharp'); return;} $ ('Product-Optional-Toggle 2') Toggle ('Sharp');}); $ ('Product-optional-checkbox3'). Change (function () {if ($ (this) .attr ("check") === "right") {$ ('. Product-optional-toggle3') ('sharp'); return;} $ (' Product-optional-toggle3 '). Toggle (' sharp ');}); For the check box, IIRC behaves oddly on the IE onchange event (compared to other browsers) and I     

(Update: I am very slow)

Edit: If you want, you can simplify your code a little bit. ...

 for  (var i = 1; i  

No comments:

Post a Comment