jquery - slide navigation to the center vertically on screen -


i developing website using scrolling parallax, 1 long website page, divided slides.

the first slide fit on screen main menu menus: us, contact , on rest of slides fit on screen.

if want click about us website can smooth scroll navigate belowthe first slide , should navigate center on targeted element , vertically centered on screen.

the html is

<a href="#aboutuscontents" class="active" title="next section" >slide 1</a> 

and think on line on jquery:

var targetoffset = $target.offset().top i'm not sure 

is responsible that, don't know how center because no center available top , left

the problem is, when navigating, topmost part of element stick edge of top of screen using targetoffset.|

to link: jquery - scroll element middle of screen instead of top anchor link same problem , link states problem is, , in line offset = eloffset - ((windowheight / 2) - (elheight / 2)); answers question.

thank you


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -