When I scroll up or down, I want a box/div to move up or down too.
For example:
See categories box
When I scroll up or down, I want a box/div to move up or down too.
For example:
See categories box
Also, in javascript you can do:
document.getElementById("my-box-fixed").style.position = "fixed";
This is all you need: http://blog.yjl.im/2010/01/stick-div-at-top-after-scrolling.html
in your css write
#my-box {
position: fixed;
}
it will probably move it from the center so you will have to do some math if it is a fixed width and height box like
#my-box-fixed {
position: fixed;
width:200px;
height: 150px;
top: 50%;
left: 50%;
margin-left: -100px; // half of the width
margin-top: -75px; // half of the height
}
you can do it whit jquery:
$().ready(function () {
var $scrollingDiv = $("#YouDivID");
$(window).scroll(function () {
$scrollingDiv
.stop()
.animate({ "marginTop": ($(window).scrollTop() + 5) + "px" }, "1000");
});
});