描述你的問(wèn)題
在使用了標(biāo)簽折疊accordion插件的html代碼中,標(biāo)題h3標(biāo)簽中的a標(biāo)簽href不起作用,不能跳轉(zhuǎn)過(guò)去。把最外層 id="accordion" 去掉就可以實(shí)現(xiàn)正常跳轉(zhuǎn),但頁(yè)面效果就沒(méi)了。
貼上相關(guān)代碼
html代碼:
<p id="accordion">
<h3>我的學(xué)習(xí)<a href="../../learning/page/learning-tasks.html" class="title-more pull-right"></a></h3>
<p>
<table class="accordion-table" id="learning-tasks">
</table>
</p>
<h3>我的考試<a href="../../exam/page/exam-proceed-list.html" class="title-more pull-right"></a></h3>
<p>
<table class="accordion-table" id="exam-proceed-list">
ble>
</p>
<h3>同步課堂<a href="javascript:;" class="title-more pull-right"></a></h3>
<p>
<table class="accordion-table" id="">
</table>
</p>
<h3>課程資源<a href="../../course/page/online-course.html" class="title-more pull-right"></a></h3>
<p>
<table class="accordion-table" id="lastest-course-list">
</table>
</p>
</p>
js代碼:
function init() {
$( "#accordion" ).accordion({
heightStyle: "fill"
});
}
css代碼就不貼了,樣式效果如下圖所示 。
點(diǎn)右上角more的圖片,頁(yè)面左下角顯示的地址是正確的,不報(bào)錯(cuò),但就是不跳轉(zhuǎn)。
相關(guān)截圖:
怎么改代碼實(shí)現(xiàn)跳轉(zhuǎn)呢?
小伙看你根骨奇佳,潛力無(wú)限,來(lái)學(xué)PHP伐。
他應(yīng)該是吧里面的默認(rèn)跳轉(zhuǎn)禁掉了,可以在a標(biāo)簽上綁定一個(gè)click事件,如下:
<a onclick=skip(this.href) />跳走了</a>
function skip(href) {
window.location.href = href;
}