Sunday, 15 March 2015

jquery - CSS scrolling div -



jquery - CSS scrolling div -

is there anyway can create scrolling greenish div force black navigation page rather scroll on top of it?

here example, scroll downwards page , banner fade , scroll:

http://www.mharrisweb.co.uk/

jquery added:

jquery(function($) { function scrollbanner() { //get scoll position of page scrollpos = jquery(this).scrolltop(); //scroll , fade out banner text jquery('.hero-unit').css({ 'margin-top' : -(scrollpos/3)+"px", 'opacity' : 1-(scrollpos/300) }); //scroll background of banner jquery('.fade').css({ 'background-position' : 'center ' + (-scrollpos/8)+"px" }); } jquery(window).scroll(function() { scrollbanner(); });`

i same effect site:

http://themetrust.com/demos/hero/

maybe can add together div.navbar-fixed-top scroll behavior ? .hero-unit. they'll move @ same "rate"

jquery css scroll

No comments:

Post a Comment