[英]show the Div and hide other Div when 'show more' link related to that company is clicked
[英]How to show the DIV related with clicked link and hide other DIVs with Jquery?
正如我在主題上總結的那樣,我想顯示與單擊鏈接相關的DIV,並使用Jquery隱藏其他DIV。 為了能夠理解我的意思,請訪問Worldlines
您將在此處看到與一些新聞相關的主題。 當某人單擊某個主題時,新聞div將向下滑動到所單擊的主題下方,並且以前閱讀的新聞div將隱藏。
我想我清楚地告訴了我想要的。
謝謝,
您將在html的開頭添加一個腳本,如下所示:
<script type="text/javascript" src="/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
function showPanel2() {
$('#Panel1').hide();
$('#Panel2').show();
}
</script>
這將隱藏一個面板並顯示另一個面板。 “ Panel1”和“ Panel2”只是您將顯示或隱藏的面板的ID。 然后在按鈕上輸入以下代碼:
<input type="button" onclick="showPanel2();" value="Submit" />
如果要隱藏多個面板,則修改起來應該足夠簡單。
jQuery手風琴是我想要的。 您可以在這里找到它http://jqueryui.com/demos/accordion/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.