我一直访问 Stackoverflow 以获得答案(很好的资源),但这是我的第一个问题。
我有 2 个 div 我需要渲染 1 在另一个之上。应该很简单,我已经做过很多次了。我的问题是它呈现相反的效果。而不是: div1 div2 我得到: div2 div1
几个小时以来一直在拉我的头发。Div1 是一个 jQuery 跳转菜单 Div2 是一个 jQuery 手风琴列表。我通过显示/隐藏方法显示它们:
$("a[id='faq_link']").click(function(){
$("div[id='agent-buynow-form']").hide();
$("div[id='mid-header']").hide();
$("div[id='jump-menu']").hide();
$("div[class='cat']").hide();
$("div[id='cat-home']").hide();
$("div[id='agent-page-header']").hide();
$("div[id='agent-page-menu']").hide();
$("div[id='agent-page-main']").hide();
$("div[id='agent-page-commissions']").hide();
$("div[id='agent-page-buycard']").hide();
$("div[id='agent-page-buybulk']").hide();
$("div[id='agent-page-newsletter']").hide();
$("div[id='agent-page-offers']").hide();
$("div[id='buynow-form']").hide();
$("div[id='archive-list']").hide();
$("div[id='jump-menu']").show();
$("div[id='faq-list']").show();
$('html, body').animate({ scrollTop: $('#faq-list')}, 'slow');
// alert("FAQ clicked");
});
跳转菜单:
<!-- Begin Jump Menu -->
<div id="jump-menu" class="top">
<table align="left" border="1px" cellpadding="2" cellspacing="2">
<tr>
<td>
Categories
</td>
<td>
Current:
</td>
<td>
<div id="selection">
<select name="jumpMenu" id="jumpMenu">
<option value="#cat-home" selected="selected">Home</option>
<option value="#cat-dining">Dining</option>
<option value="#cat-shows">Shows</option>
<option value="#cat-tours">Tours</option>
<option value="#cat-nightlife">Nightlife</option>
<option value="#cat-shopping">Shopping</option>
<option value="#cat-attractions">Attractions</option>
<option value="#cat-golf">Golf</option>
<option value="#cat-transportation">Transportation</option>
<option value="#cat-spas">Spas</option>
<option value="#cat-sports">Sports</option>
<option value="#cat-events">Special Events</option>
<option value="#cat-weddings">Weddings</option>
</select>
</div>
</td>
</tr>
</table>
</div>
<!-- End Jump Menu -->
常见问题列表:
<!-- Begin FAQ list -->
<div id="faq-list" style="display:none;">
<table>
<tr>
<td style="height:131px; line-height:15px; padding-left:5px; padding-right:5px;">
<div align="center"><B>--- FREQUENTLY ASKED QUESTIONS --- </B> </div>
<div id="accordion">
<content>
Does the ******* Card expire?
</content>
<div>
Yes, all ******* Cards are valid one year from the date of purchase.
</div>
<content>
How many places accept this card?
</content>
<div>
We currently have over 500 merchan
</div>
<content>
How do I use my card?
</content>
<div>
Simply present your *********** at
</div>
<content>
What if I am traveling to ******** and do not have time for a card to be mailed to me?
</content>
<div>
When purchasing your card simp
</div>
<content>
Do the discounts change or will they always be the same?
</content>
<div>
We are continually adding new
</div>
<content>
Can I buy more than one card?
</content>
<div>
Yes, you can buy as many *****
</div>
<content>
If the card is lost or stolen, can it be replaced?
</content>
<div>
Lost or stolen cards less than one year old can be replaced for the cost of shipping.
</div>
<content>
What do I do when my card expires?
</content>
<div>
Unfortunately, each ***** only
</div>
<content>
How long is each offer valid?
</content>
<div>
The merchants that provides
</div>
<content>
Do I have to book things ahead of time?
</content>
<div>
You do not have to book in
</div>
<content>
Is there a customer service number people can call?
</content>
<div>
Yes, your card comes with our Customer service number.
</div>
<content>
Can locals use the card too?
</content>
<div>
Yes, locals are welcome to use the card as well.
</div>
<content>
Can I get a discount for my entire party?
</content>
<div>
For dinner reservations,
</div>
</div>
</td>
</tr>
</table>
</div>
<!-- End FAQ -->
我也没有在 css 中看到任何不寻常或不寻常的东西。
其他 div 似乎以正确的顺序显示。
有任何想法吗?
谢谢