How does this single page display content in blocks?
I put it
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#nav a").click(function(){
href = $(this).attr('href');
if (href.slice(0, 1)=='#') {
type = href.slice(1);
$(".content").fadeOut(350);
$("#content-" + type).fadeIn(350);
}
});
});
</script>
<style>
.content {
padding-left: 20px;
display: none;
position: absolute;
top: 0;
left: 0;
}
</style>
Took these two pieces down,
Then my settings are set like this
Navigation
<p id="nav" style="margin-bottom:20px">
<a href="#product-jichu" class="summary current">基本信息</a>
<a href="#product-canshu" class="desc">详情</a>
<a href="#product-pinglun" class="review">评价</a>
</p>
content
<p class="content" id="content-product-info" style="display:block;">
测试页面1
</p>
<p class="content" id="content-product-canshu">
测试页面2
</p>
<p class="content" id="content-product-pinglun">
测试页面3
</p>
Why can't this have the same effect as him?
It was displayed when I opened it, and then everything disappeared after clicking the navigation. Is there anything wrong?
黄舟2017-05-16 13:18:49
Okay, it’s still my own problem. I don’t know why the content in the script was swallowed by the program