开发者

HTML Select Stays Open

Got an HTML Select with an onChange() event that calls a method which takes about 5 seconds to complete.

In IE, the select remains open until the method has completed - just looks kind of tacky. In Firefox, Chrome, and Safari, the Select appears to close without waiting for the method to complete.

I've also tried using the jQuery change开发者_C百科() method and that doesn't help either.

Has anyone seen this before? Recommendations?


You could use a timeout and call your method after a small delay - that would give the drop-down enough time to close:

element.onchange = function() {
  setTimeout(method, 100);
};

The real question is why your method takes 5 seconds in the first place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜