当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Trouble using multiple instances of a jQuery UI control on a page. Multiple uses of the accordion control

问题描述:

On the page I am making, I need to use the jQuery UI accordion control twice. I am able to use it one time with no problems, but when I try to use it add another one on the same page, the first one stops working and the second one IS working.

Any ideas?

Link to the code

网友答案:

You cannot use the same ID in the same page - per W3C specifications. Depending on which browser renders the content - you won't get the same behavior. You need to use classes or custom attributes to trigger the accordion behavior. IE is one browser that will not handle elements with repeating element IDs (other browsers are more lenient with the spec).

分享给朋友:
您可能感兴趣的文章:
随机阅读: