底部留出空間這是一個負責任的設計和變換:平移Y(2000像素);已應用於底部的塊。 Chrome中的動畫效果很好,但動畫似乎在頁面底部留下了空白區域。這隻在Chrome中發生。在對鉻
項目鏈接:
http://50.87.144.37/~projtest/team/design/Call/
CSS:
.come-in {
transform: translateY(2000px);
-webkit-transform: translateY(2000px);
animation: come-in 0.8s ease forwards;
-webkit-animation: come-in 0.8s ease forwards;
}
.come-in:nth-child(odd) {
animation-duration: 0.6s; /* So they look staggered */
-webkit-animation-duration: 0.6s;
}
JS:
(function($) {
$.fn.visible = function(partial) {
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop(),
viewBottom = viewTop + $w.height(),
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};
})(jQuery);
$(window).scroll(function(d){
$(".unWcalls").each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("come-in");
}
});
});
僅供參考,動畫不_at ALL_在Chrome 33在Mac上運行。 –
我不得不刪除效果,因爲我找不到任何解決方案。如果並且當你願意研究這個問題,請在這裏發帖,我會進行修改,以便你可以查看它。 – AnAspiringCanadian
首先,祝賀你的前端設計。這是非常實用和愉快的反應。我想幫助你解決你的問題,但是看不到Firefox和Chrome之間的區別。你使用的是什麼版本的Chrome?謹慎添加預期和錯誤實驗的屏幕截圖? – Kad