基本上我试图编写jquery在一个封闭div内切换对象的(div,class),并以三种不同的方式相应地替换它,具体取决于点击的导航按钮,默认为着陆页/动画。jquery内容动态
我想替换着陆页的内容来动态更改,所以我不会编写三个单独的代码页,只需在访问者点击两个单独的按钮时更改一个div内的元素即可。我遇到的唯一问题可能是我的语法...我得到的代码工作隐藏元素...这是键入下面, ,因为我试图removeClass/addClass或toggleClass与它斗争数小时到没有无济于事。
这是我目前的版本---我现在质疑的另一件事是为什么.hide(this);在我的第二个函数中淡出内容,而.hide()本身不会褪色,我喜欢淡入淡出的效果,但我确信我可以找到正确的方法来做到这一点,因为它可能是一个怪癖?不确定
**$(document).ready(function() {
$("**#oneway**").click(function() {
$("**.lee**:first").hide();
});
$("**#secondway**").click(function() {
$("**.lee**:first").hide(this);
});**
我会写相应的HTML和CSS ,感谢您的时间阅读
HTML
<div class="**enlosing**">
<nav>
<ul class="Nav">
<li id="stuff"><a href="blah.html" target="_self" >STUFF</a></li>
<li id="quality"><a href="**#oneway**" target="_self">QUALITY</a></li>
<li id="stuff2"><a href="blahblah.html" target="_self">STUFFALSO</a></li>
<li id="contact"><a href="**#secondway**" target="_self">CONTACT</a></li>
</ul>
</nav>
</div>
<div class="**lee**">
<div class="**ex**">
<div class="place">
<a class="gotoplace" href="http://www.link.com" target="_self"></a>
</div>
</div>
<div/>
CSS
.ex{
display: table-cell;
text-align: center;
position: absolute;
top: 0; left: 0;
background-image: url(../img/seal.png);
background-position: left;
background-repeat:no-repeat;
margin-left:center;
height:100%;
width:100%;
}
我一直试图让.ex以多种方式动态更改,同时保持页面的其余部分相同。
由于这个问题已被问到在这个网站上的各种方式,我已经经历了很多,但不能区分我现在的问题。如果有与我的代码具体相关的答案或问题,请原谅我的疏忽。
为什么有'*''在你的属性呢? – 2012-01-13 21:56:30