我试图将相同的脚本应用到同一index.html文件中的Supersized jQuery plug-in 2个案例中,但是当我更改z-index时...允许我只是激活(应用/使用)一个立即生效。
您可以使用this link下的结果 如果你想尝试一下;请将代码放在Supersized jQuery Plug-in
中我真的会帮助你。 Thnx提前。
HTML
<!-- --------------- First DIV--------------- -->
<footer>
<div class="toggle-footer">About me</div>
<div id="footer-content">
<div id="footer-right">
<ul class="lv">
<li><a href="" id="home">Home</a></li>
<li><a href="" id="about">About</a></li>
<li><a href="" id="project">Project</a></li>
<li><a href="" id="contact">Contact</a></li>
</ul>
</div>
<div id="footer-left">
<h3><a href="">XBO Design</a></h3>
</div>
</div>
</footer>
<!-- --------------- Second DIV --------------- -->
<news_footer>
<div class="news_toggle_footer">menu</div>
<div id="news_footer_content">
<div id="news_footer_right">
<ul class="lv">
<li><a href="?page=home" id="home">Home</a></li>
<li><a href="?page=about" id="about">About</a></li>
<li><a href="?page=project" id="project">Project</a></li>
<li><a href="?page=contact" id="contact">Contact</a></li>
</ul>
</div>
<div id="news_footer_left">
<h3><a href="?page=home">Scott Yetman Design</a></h3>
</div>
</div>
</news_footer>
CSS
<!-- --------------- First DIV--------------- -->
footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
padding-bottom: 42px;
z-index: 4;
}
#footer-content {
display: none;
}
#footer-left {
width: 20%;
height: 145px;
float: left;
;
opacity: 0.8;
background-color: #A40000;
}
#footer-left h3 a {
color: #B2816E;
text-transform: lowercase;
}
#footer-right {
width: 80%;
height: 145px;
float: right;
background:#000;
opacity: 0.8;
}
.toggle-footer {
width: 60px;
padding: 10px;
cursor: pointer;
text-align: center;
opacity: 0.8;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
margin-left: 0px;
font-size: small;
color: #FFF;
background-color: #A40000;
}
<!-- --------------- Second DIV --------------- -->
news_footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
padding-bottom: 42px;
z-index: 4;
}
#news_footer_content {
display: none;
}
#news_footer_left {
width: 20%;
height: 145px;
float: left;
background-color: #5C4033;
opacity: 0.8;
}
#news_footer_left h3 a {
color: #B2816E;
text-transform: lowercase;
}
#news_footer_right {
width: 80%;
height: 145px;
float: right;
background-color: #B29F63;
opacity: 0.8;
}
.news_toggle_footer {
width: 100px;
margin: 0 auto;
padding: 10px;
cursor: pointer;
text-align: center;
background-color: #B29F63;
opacity: 0.8;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
的JavaScript
jQuery(document).ready(function(){
$(".toggle-footer").click(function(){
$("#footer-content").slideToggle("slow");
});
});
jQuery(document).ready(function(){
$(".news_toggle_footer").click(function(){
$("#news_footer_content").slideToggle("slow");
});
});