0
很抱歉的標題名稱,我不知道該如何解釋這個笑..顯示/隱藏只顯示當前內容
基本上,我有打開使用jQuery在同一頁上的內容的頁面..基本上當頁面加載時,簡要部分打開,但是當你點擊另一個鏈接時,這個內容應該關閉,新內容應該加載..我甚至嘗試過:「.show(0).siblings()。隱藏(0);」但這只是隱藏了一切,只是顯示了這個特殊的div。
下面是代碼:
<html>
<head>
<link rel="stylesheet" type="text/css" href="CSS-reset.css">
<link rel="stylesheet" type="text/css" href="testing.css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<header id="header-main" role="Header, banner, logo">
<hgroup class="logo" role="logo">
<img src="Logo.png" width="150" height="150">
</hgroup>
</header>
<nav class="navigation" role="navigation">
<a href="#" id="briefLink">Brief</a><br />
<a href="#" id="researchLink">Research</a><br />
<a href="#" id="ideasLink">Ideas</a><br />
<a href="#" id="designLink">App Design</a><br />
<a href="#" id="implementationLink">Implementation</a>
</nav>
<section class="content brief" role="Things about the brief">
BRIEF
</section>
<section class="content research" role="Things for research">
RESEARCH
</section>
<section class="content ideas" role="The ideas part goes here">
IDEAS
</section>
<section class="content design" role="The design part goes here">
DESIGNS
</section>
<section class="content implementation" role="The implementation goes here">
IMPLEMENTATION
</section>
<script>
$(document).ready(function()
{
//$('.brief').hide();
$('.research').hide();
$('.ideas').hide();
$('.design').hide();
$('.implementation').hide();
$('#researchLink').click(function()
{
var divname= this.name;
$('.research').show(0).siblings().hide(0);
});
$('#ideasLink').click(function()
{
$('.ideas').show();
});
$('#designLink').click(function()
{
$('.design').show();
});
$('#implementationLink').click(function()
{
$(toggle);
$('.implementation').show();
});
});
</script>
當然,你可以接受的七個答案中有一個很好的答案,或更多? –
我還沒有問過這七次,謝謝。 – Phorce