我有一個test setup縮略圖div淡入另一個div,但它有一些問題。淡入淡出一格:更穩定,刪除白色暫停,多淡淡
- 如何消除白色暫停?目前它將一格轉換爲白色,然後淡入第二格。我怎樣才能讓它從一個div淡出到另一個沒有淡化成白色?
- 這是一個有點不穩定,如果你快速懸停結束第二個div出現在原來的下面。我怎樣才能讓它更加穩定?
- 我將在每個圖像和文本中添加多個縮略圖,如何將網格設置爲包含多個框,而不是一次全部淡入/淡出(即分開)。
下面的代碼:
Javacript:
<script type="text/javascript">
$(document).ready(function(){
$(".phase-2").hide();
});
$(function(){
$('.grid-box').hover(
function(){
$('.grid-box .phase-1').fadeOut(300, function(){
$('.grid-box .phase-2').fadeIn(300);
});
},
function(){
$('.grid-box .phase-2').fadeOut(300, function(){
$('.grid-box .phase-1').fadeIn(300);
});
}
);
});
</script>
HTML:
<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>
白停頓是因爲其知名度變爲零;使用帶有不透明度選項的動畫來淡入和淡出,並將其保持在50%,然後在完成後使用隱藏。 – Val 2011-05-17 10:11:42
謝謝瓦爾,只是錯過了你的答案。你有一個我能看的代碼示例嗎?這是我的能力的最前沿! – Rob 2011-05-17 10:22:02
這聽起來好像你的回答會讓我更加控制,如緩和,不透明和持續時間,這聽起來很完美。 – Rob 2011-05-17 10:29:18