jQuery手风琴 - 改变点击事件的行为

时间:2014-07-20 17:49:26

标签: jquery html css jquery-ui accordion

我使用手风琴基本上显示书中的章节列表。目前用户需要点击标题,然后手风琴下降以显示简短的几个单词'和'一个链接,将它们带到实际的pdf文档。这样可以正常工作,但是我被问到手风琴的内容标题是否可以直接打开,无需下拉和点击链接。

我没有处理很多手风琴而且有点像查询noob,这是否可行? css针对相同的元素,所有尝试都失败了。

我已经添加了下面的代码,生成可能有帮助的手风琴。如果我可以从项目[0](内容)中删除下拉效果,我将取得良好的进展:)

感谢您的帮助。

<div id="accordion">
    <?php
    $description = array(
        "Contents",
        "Introduction",
        "Lifecycle",
        "Data Management",
        "Assurance",
        "Pressure Management",
        "Abandonment");
    $title = array(
        "Contents",
        "Introduction",
        "Lifecycle",
        "Well Integrity Assurance",
        "Assurance",
        "Annular Pressure Management",
        "Abandonment",
        "appendicies");
    $contents = <<<EOT
            <h3><a href="#">$title[0] </a></h3>
            <div class=trainingItemListContainer>
                <div class="subDetails">
                    <div class="viewAndDownload">
                        <a href="training_chap01.php"><p>View Contents</p></a>
                    </div>
                </div>
            </div>
            <h3><a href="#">Chapter 01 - $title[1] </a></h3>
            <div class=trainingItemListContainer>
                <div class="subDetails">
                    <div class="viewAndDownload">
                        <a href="training_chap02.php"><p>View Contents</p></a>
                    </div>
                </div>
            </div>
EOT;
    echo $contents;
    for($i=2; $i <= 6; $i++){
        $number = str_pad((($i-1 ) + 1), 2, "00", STR_PAD_LEFT);
        $number2 = str_pad(($i  + 1), 2, "00", STR_PAD_LEFT);
        $body = <<<EOT
            <h3><a href="#">Chapter $number - $title[$i] </a></h3>
            <div class=trainingItemListContainer>
                <div class="subDetails">
                    <div class="viewAndDownload">
                        <a href="training_chap$number2.php"><p>View chapter</p></a>
                    </div>
                </div>
            </div>

EOT;
    echo $body;
    }
            $appendicies = <<<EOT
            <h3><a href="#">Appendix 4 - Worked Example, Derivation of MAASP</a></h3>
            <div class=trainingItemListContainer>
                <div class="subDetails">
                    <div class="viewAndDownload">
                       <a href="training_chap08_app3.php"><p>View appendix details</p></a>
                    </div>
                </div>
            </div>
EOT;
    echo $appendicies
    ?>

    <!--end accordion div--> </div>

0 个答案:

没有答案