javascript - jQuery Scrolly plugin - parallax background jumps by preceding element's height -


demo: http://christianbullock.org/jstest/

i'm trying implement basic parallax banner on freelance project. i'm using: https://github.com/victa/scrolly

problem though. when there's element placed before parallax banner, when begin scrolling, parallax background's position jump height of preceding element.

in case, red banner 218px high. when begin scrolling, green background's position jump 218px.

note: isn't problem if parallax element first element on page. it's not problem if red banner removed document flow through fixed positioning.

i'm thinking culprit this, wouldn't know begin diagnosing:

// fix background position if(this.bgstart){ position = position + this.bgstart; }  if(this.options.bgparallax === true) {   this.$element.css({backgroundposition: '50% '+position+'px'}); } else {   this.$element.css({top: position}); } 

really appreciate pointers. thanks! :)

fixed. had add:

data-fit="-218"  

to account banner @ top :)


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -