0

我使用 ui 库创建手风琴标签,它适用于所有浏览器,但不适用于 IE8

这是我的代码:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>jQuery UI Accordion - Sortable</title>
    <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">

    <script src="../../jquery-1.8.3.js"></script>
    <script src="../../ui/jquery.ui.core.js"></script>
    <script src="../../ui/jquery.ui.widget.js"></script>
    <script src="../../ui/jquery.ui.mouse.js"></script>
    <script src="../../ui/jquery.ui.sortable.js"></script>
    <script src="../../ui/jquery.ui.accordion.js"></script>
    <link rel="stylesheet" href="../demos.css">

    <script>
    $(document).ready(function() {

    $("#acc1").accordion({
            active:".ui-accordion-left", 
            alwaysOpen: false,
            autoheight: false,
            header: 'a.acc1',
            clearStyle: true
    });
    $("#acc2").accordion({
            active:".ui-accordion-left", 
            alwaysOpen: false,
            autoheight: false,
            header: 'a.acc2',
            clearStyle: true
    });

});
    </script>
</head>
<body>
<ul id="acc1" class="ui-accordion-container">
    <li>
        <div class="ui-accordion-left">
            </div>
                  <a class="ui-accordion-link acc1">1a
                     <span class="ui-accordion-right"></span>
                      </a>
                      <div>
                        data of 1a<br/>
                        data of 1a<br/>
                        data of 1a<br/>
                        <ul class="ui-accordion-container" id="acc2">
                        <li>
                                <div class="ui-accordion-left">
                              </div>
                                <a class="ui-accordion-link acc2">2a
                                <span class="ui-accordion-right"></span>
                             </a>
                                <div>
                                data of 2a<br/>
                                data of 2a<br/>
                                data of 2a<br/>
                                </div>
                        </li>
                        <li>
                                <div class="ui-accordion-left">
                              </div>
                                <a class="ui-accordion-link acc2">2b
                                <span class="ui-accordion-right"></span></a>
                                <div>
                              data of           2b<br/>
                                data of 2b<br/>
                                data of 2b<br/>
                                </div>
                        </li>
                </ul>
                </div>
      </li>
    <li>
              <div class="ui-accordion-left"></div>
                <a class="ui-accordion-link acc1">1b
                <span class="ui-accordion-right"></span></a>
               <div>
                data of 1b<br />
                      data of 1b<br />
                      dta of 1b <br />
               </div>
    </li>
</ul>


<div class="demo-description">
<p>Drag the header to re-order panels.</p>
</div>
</body>
</html>

来自 Firefox 的屏幕截图有效: 火狐 来自 IE8 的屏幕截图无效: IE 我想我错过了一些东西!如何解决?

提前致谢

4

1 回答 1

0

添加脚本类型

 <script type="text/javascript">

    $(document).ready(function() {

    }):

</script>
于 2013-01-16T11:03:11.363 回答