IE8 html select needs two clicks to open dropdown

后端 未结 2 1121
不思量自难忘°
不思量自难忘° 2021-01-27 18:37

Here is my code.







        
相关标签:
2条回答
  • 2021-01-27 19:11

    At this moment I don't have an IE8 Please try to add $('#click').unbind('dblclick'); after create select element, it will dissable #click dblclick event.

    $(function() {
         $("#click").dblclick(function(e) {
              var options = "<select id='combobox'>"
              for ( var i = 0; i < 50; i++) {
                   options += '<option value="ActionScript">Value - ' + i + '</option>';
              }
    
              $(this).html(options + "</select>");
              $('#click').unbind('dblclick');
         });
    });
    
    0 讨论(0)
  • 2021-01-27 19:28

    Finally I have found this solution. I have use jQuery appendTo as in $(options + "</select>").appendTo(this); method instead of .html as in $(this).html(options + "</select>"); .

    0 讨论(0)
提交回复
热议问题