relative scrollbar

i want to implement dive scroll bar which will be in sync with window scroll bar

by rajutikale

JavaScript

/*i have implimented it like this please help */$(document).ready(function(){ $('.scrollbar1').tinyscrollbar(); $('.scrollbar1').scroll(function(){ var heightDiv = document.getElementById('.scrollbar1').clientHeight; alert(heightDiv); var height = document.body.offsetHeight; jQuery(document).scroll(function(){ var moved = jQuery(window).scrollTop(); var ratio = moved*heightDiv*20/height; jQuery('.scrollbar1').animate({scrollTop: ratio}); }) }); });