어떻게 두 번째 이미지가 희미 해집니다. z-index
및 opacity
과 관련이 있다고 생각합니다. jQuery fadeIn이 Z- 인덱스와 함께 작동하지 않습니다.
$(document).ready(function() {
$(window).scroll(function() {
$('.fade-in').each(function(i) {
var bottom_of_object = $(this).position().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* If the object is completely visible in the window, fade it it */
if (bottom_of_window > bottom_of_object-$(this).outerHeight()/2) {
$(this).animate({
'opacity' : '1'
}, 500);
}
});
});
});
.fade-in {
opacity:0 ;
}
.row {
position: relative;
width:100%;
height: 600px;
background: #000000;
}
.offset {
height:1000px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="offset">scroll down</div>
<div class="row">
<img src="http://assets3.parliament.uk/iv/main-large//ImageVault/Images/id_7382/scope_0/ImageVaultHandler.aspx.jpg" alt="test" class="fade-in"/>
</div>
<img src="http://assets3.parliament.uk/iv/main-large//ImageVault/Images/id_7382/scope_0/ImageVaultHandler.aspx.jpg" alt="test" class="fade-in"/>
당신은 실제로 단지 게으른로드없이 다시 만들 ** 이미지 게으른로드 ** ...을하려고합니까? –