jQuery Accordion - 如何在标题标题中添加可点击的项目?

时间:2011-09-23 07:51:31

标签: jquery accordion jquery-ui-accordion

  

可能重复:
  How to make only specific text clickable on accordion header - jquery?

我正在寻找一种在jQuery Accordion Title(标题)中添加可点击项的方法。我正在使用默认的Accordion(http://jqueryui.com/demos/accordion/#default):

<div id="accordion">
    <h3><a href="#">Section 1</a></h3>
    <div>
        <p>blah</p>
    </div>
    <h3><a href="#">Section 2</a></h3>
    <div>
        <p>blah blah</p>
    </div>
    <h3><a href="#">Section 3</a></h3>
    <div>
        <p>blah blah blah</p>
    </div>
</div>

我希望有类似的东西:

<div id="accordion">
    <h3><a href="#">Section 1</a><span style="align:right"><a href="http://www.stackovweflow.com">SO</a> - <span style="align:right"><a href="http://www.stackovweflow.com">SO2</a></span></h3>
    <div>
        <p>blah</p>
    </div>
    <h3><a href="#">Section 2</a><span style="align:right"><a href="http://www.stackovweflow.com">SO</a> - <span style="align:right"><a href="http://www.stackovweflow.com">SO2</a></span></h3>
    <div>
        <p>blah blah</p>
    </div>
    <h3><a href="#">Section 3</a><span style="align:right"><a href="http://www.stackovweflow.com">SO</a> - <span style="align:right"><a href="http://www.stackovweflow.com">SO2</a></span></h3>
    <div>
        <p>blah blah blah</p>
    </div>
</div>

其中“X部分”表示手风琴和其他链接是独立的。有什么想法吗?

这里的“跨度”是新的......

修改

好的,得到它: How to make only specific text clickable on accordion header - jquery?

<div id="accordion" class="ui-accordion2-group">
    <h3 class="ui-accordion2-header"><a href="#">Section 1</a>
        <div class="tools">
            <a href="http://www.stackovweflow.com">SO</a>
            <a href="http://www.stackovweflow.com">SO2</a>
        </div>
    </h3>
    <div>
        <p>blah</p>
    </div>
</div>
<style>
.ui-accordion2-header .tools{
    position: absolute;
    right: 1px;
    top: 8px;
    width: 300px;
}
.ui-accordion2-header .tools a {
    width: auto;
    display: inline;
}
</style>

诀窍!

0 个答案:

没有答案