I am using this tutorial http://jqueryfordesigners.com/fixed-floating-elements/ to make my div move with page while user scrolling. It works like a charm, but until you reach bottom of my web and div have still position fixed and still moving from his parental div to footer. JavaScript:
$(document).ready(function () {
var top = $('#comment').offset().top - parseFloat($('#comment').css('marginTop').replace(/auto/, 0));
$(window).scroll(function (event) {
// what the y position of the scroll is
var y = $(this).scrollTop();
// whether that's below the form
if (y >= top) {
// if so, ad the fixed class
$('#comment').addClass('fixed');
} else {
// otherwise remove it
$('#comment').removeClass('fixed');
}
});
});
CSS:
#comment.fixed {
position: fixed;
top: 0;
}
Here is my page, so you can look what exactly is my problem: http://testportal.jon.cz/projekt-konfigurator/konfig.html
Sorry for my english and thanks for your answers :)