我在與衰落的一個DIV到另一個一些輕微的問題,這是我的代碼(test page):衰落一個DIV到另一個
HTML:
<div id="grid">
<div class="grid-box">
<div class="phase-1">
<img class="grid-image" src="http://teamworksdesign.com/v2/wp-content/themes/default/images/dtr.jpg" alt="" height="152" width="210" />
<div class="grid-heading">
<h2>DTR Medical</h2>
<h3>Branding, Web, Print</h3>
</div>
</div>
<div class="phase-2">
<div class="grid-info">
<h4>Probeything 2000</h4>
<p>Marketing unglamorous single-use medical intruments is not simple. We helped Neurosign increasetheir sales by 25% and increasemarket awareness.</p>
</div>
<div class="grid-heading-hover">
<h2>DTR Medical</h2>
<h3>Branding, Web, Print</h3>
</div>
</div>
</div>
</div>
的Javascript:
<script type="text/javascript">
$(document).ready(function(){
$(".phase-2").hide();
});
$(function(){
$('.grid-box').hover(
function(){
$('.grid-box .phase-1').fadeOut(200, function(){
$('.grid-box .phase-2').fadeIn(200);
});
},
function(){
$('.grid-box .phase-2').fadeOut(200, function(){
$('.grid-box .phase-1').fadeIn(200);
});
}
);
});
</script>
CSS:
.phase-1 .grid-image {
width:210px;
height:220px;
overflow:hidden;
}
.phase-2 {
position:relative;
top:-220px;
}
更新: 我有一個「工作」(請參閱測試鏈接問題)。是否有可能阻止它在白色下降然後在下一階段褪色?我想淡化兩個div,而不是先白。
我們在測試頁上看什麼?發生了什麼,你期望會發生什麼? – 2011-05-17 08:11:55
看起來像'$'在頁面中被覆蓋,不再指向jQuery。 – 2011-05-17 08:14:22
對不起,縮略圖是我想要淡化的。噢,我想這可能會做到!完全忘了我在另一頁上移除了Nivo幻燈片! – Rob 2011-05-17 08:28:26