为什么我的上下文选择器和.buttonset()在ie中花费了这么长时间

why is my context selector and .buttonset() taking so long in ie

本文关键字:长时间 ie 选择器 上下文 我的 buttonset 为什么      更新时间:2023-09-26

所以我认为这是我明显做错的事情。这件事太慢了。

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();

    var mother = $(​​​​​​​​​​​​​​'#mother');
​    $('#radio', mother).buttonset();​​​​​​
    $('#radioTwa', mother).buttonset();
    $('#check', mother).buttonset();

这两件事都会让IE 8屈服,让它哭出来。为了把一些事情扼杀在萌芽状态,我故意使用母亲的上下文。我没有每个单选框的唯一ID,我计划使用上下文来选择它们,因为页面上有很多"母亲"类型的div,尽管我使用的每个母亲div元素中只有大约8或9个元素。在IE 8中,没有办法使用上下文来快速选择吗?

您总共有多少个按钮?关于stackoverlow上的慢按钮,似乎有一些同谋。我还发现了错误。jqueryui.com/ticket/5544–Nal