<div class="fixed hidden">
Фиксированный блок
</div>
.fixed {
position: fixed;
bottom: 30px;
right: 30px;
width: 100px;
height: 50px;
background: #000;
}
.fixed.hidden {
display: none;
}
var $win = $(window),
$fixed = $(".fixed"),
limit = 300;
function tgl (state) {
$fixed.toggleClass("hidden", state);
}
$win.on("scroll", function () {
var top = $win.scrollTop();
if (top < limit) {
tgl(true);
} else {
tgl(false);
}
});