why is my context selector and .buttonset() taking so long in ie
-
01-07-2021 - |
Question
So I assume this is something I'm doing flagrantly wrong. It is soo slow in ie there must be something fundamentally wrong with this.
Le HTML
<div id='mother'>
<div id="radio">
<input type="radio" id="radio1" name="radio" />
<label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio" checked="checked" />
<label for="radio2">Choice 2</label>
</div>
<div id="radioTwa">
<input type="radio" id="radioTwa1" name="radioTwa" />
<label for="radioTwa1">Choice 1</label>
<input type="radio" id="radioTwa2" name="radioTwa" checked="checked" />
<label for="radioTwa2">Choice 2</label>
</div>
<div id="check">
<input type="checkbox" id="check1" name="check" />
<label for="check1">Choice 1</label>
<input type="checkbox" id="check2" name="check" checked="checked" />
<label for="check2">Choice 2</label>
</div>
</div>
Le JQuery/JQuery UI
var mother = $('#mother');
mother.find('#radio').buttonset();
mother.find('#radioTwa').buttonset();
mother.find('#check').buttonset();
or
var mother = $('#mother');
$('#radio', mother).buttonset();
$('#radioTwa', mother).buttonset();
$('#check', mother).buttonset();
Both of these will bring IE 8 to it's knees and make it cry. To nip some things in the bud I am using the context of mother on purpose. I do not have a unique ID to each radio box, I planned to select them using context, because of the number 'mother' type divs that are on the page though each mother div element I am using only has about 8 or 9 elements within it. Is there no way to select using context in IE 8 that is quick enough to not grind it to a halt?
Solution
How many buttons do you have total? There seems to be a few compliants about slow buttonssets on stackoverlow. Also I found bugs.jqueryui.com/ticket/5454 – Nal