我有导航菜单,一旦用户点击,然后更改和淡入内容。问题是甚至孩子节点变得隐藏起来。如果我删除了我的div id =“witness”和id =“believe”的所有子节点,那么它工作正常。如何排除div id =“witness”或id =“believe”的子节点?jquery淡入淡出内容
在此先感谢。
这里是我的javascript
$(function(){
$("#content-linkwrap .hrefmenu").click(function(){
$clicked = $(this);
// if the button is not already "transformed" AND is not animated
// each button div MUST have a "xx-button" and the target div must have an id "xx"
var idToLoad = $clicked.attr("id").split('-');
//we search trough the content for the visible div and we fade it out
$("#description").find("div:visible").fadeOut("fast", function(){
//once the fade out is completed, we start to fade in the right div
$(this).parent().find("#"+idToLoad[0]).fadeIn();
})
});
});
这里是我的html
<div align="center" id="content-linkwrap"><a href="#" class="link-black hrefmenu" id="witness-href">WITNESS</a><a href="#" class="link-black hrefmenu" id="believe-href">BELIEVE</a></div>
<div id="description">
<div id="witness" class="desc">
<div class="top"><div class="bottom"><div class="left"><div class="right"><div class="bl"><div class="br"><div class="tl"><div class="tr">
<div style="padding: 40px 20px;">
<h3 class="text-orange">WITNESS</h3>
<p class="aboutus wpad10" align="justify">To a company that has initiated major retail projects representing more than US $10 million in investments.
</p>
<p class="aboutus" align="justify">To a conglomerate so solid and expansive with far-reaching business interests and investments in food service, real estate, electronics, heavy equipment, jewelry trading, travel, and hardware trading that spans the Philippines, Hong Kong, Singapore and Malaysia. </p>
</div>
<div class="clearleft"></div>
</div></div></div></div></div></div></div></div>
</div>
<div id="believe" class="desc">
<div class="top"><div class="bottom"><div class="left"><div class="right"><div class="bl"><div class="br"><div class="tl"><div class="tr">
<div style="padding: 40px 20px;">
<h3 class="text-orange">BELIEVE</h3>
<p class="aboutus wpad10" align="justify">In a corporation that toasts not only the successes – but also the opportunities.
</p>
<p class="aboutus wpad10" align="justify">In a business entity that puts a high premium on freedom and creative participation of its people at all levels…</p>
<p class="aboutus wpad10" align="justify">In a management that is committed to corporate expansion, to the personal growth of its people, and to partnerships and ventures that are mutually beneficial…</p>
</div>
<div class="clearleft"></div>
</div></div></div></div></div></div></div></div>
</div>
</div>
嗨马特, 非常感谢。它的工作完美。 我非常自豪地使用这个论坛。 – tirso 2009-11-18 11:04:58