以下のスクリプトをjQuery Waypoints プラグインと共に使用して、要素がブラウザー ウィンドウの中央に 50% (または 75%) 配置されたときに要素を 100% の不透明度にフェードします。要素が最初にフェードインしないように見えることを除いて、コードはかなりうまく機能しているようです。下にスクロールしてから元に戻すと、要素がトリガーされているようです。
$(document).ready(function() {
$('#feature').waypoint(function(event, direction) {
var targetOpacity = direction === "down" ? 1 : .25;
$(this).stop().animate({ "opacity": targetOpacity });
}, {
offset: '50%'
});
$('#footer').waypoint(function(event, direction) {
var targetOpacity = direction == "down" ? 1 : .25;
$(this).stop().animate({ "opacity": targetOpacity });
}, {
offset: '75%'
});
});