parallax - jquery sticky background scroll -


i want achieve this;

http://wind-dance.com/sticky/

i want html fixed position until image scroll till bottom. script coded scroll along html scroll.

is there jquery script achieve similar effect want?

update 1

maybe question above not clear. changed way of question then. want scroll div element without scrolling body content till div element reached bottom. hope make clear everyone. , inline script current code achieve partial of it.

update 2

looking @ @bhavesh solution, tried modify this

$(document).ready(function() {     var row = $('.row');     var scroll_banner = $('.scroll_banner');     var scroll_banner_height = scroll_banner.height();     var row_height = row.height();      $(window).on('scroll', function() {         scroll_banner_height = scroll_banner.height();         var windowpos = $(this).scrolltop();         var scrollableamount = windowpos / row_height * scroll_banner_height;         row.scrolltop(scrollableamount);     }) }); 

it bad scrolling , feel jumpy experience having scrolltop on body on each scroll.

you can find inline script in example in example attaching on window scroll event div scroll (which contains image) using scrolltop property.

$(document).ready(function() {     var row = $('.row');     var scroll_banner = $('.scroll_banner');     var scroll_banner_height = scroll_banner.height();     var row_height = row.height();      $(window).on('scroll', function() {         var windowpos = $(this).scrolltop();         var oldrowpos = row.scrolltop();         row.scrolltop(oldrowpos+windowpos);         var newrowpos = row.scrolltop();         console.log([scroll_banner_height-row_height,newrowpos]);         if (newrowpos < (scroll_banner_height-row_height)) {             $(this).scrolltop(0);         }     }) }); 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -