Hello Friend,
define a function on the mouse scroll event like this below
window.onload = function()
{
//adding the event listerner for Mozilla
if(window.addEventListener)
document.addEventListener('DOMMouseScroll', moveObject, false);
//for IE/OPERA etc
document.onmousewheel = moveObject;
}
Then in that function you have to check the position of the scroll bar if it exceeds the actual page size you have to reduce the opacity for the div and if it moves towards the actual page height increase the opacity of the div.
This info would help you solve your challenge.
Ahamed