简体   繁体   English

水平滚动jQuery固定导航

[英]Horizontal scrolling jQuery fixed navigation

I am creating a web page that has a horizontal scrolling effect such as this one http://retrousse.co.uk/lookbook , i am currently using this example as a template http://tympanus.net/Tutorials/WebsiteScrolling/ 我正在创建一个具有水平滚动效果的网页,例如http://retrousse.co.uk/lookbook ,我目前正在将此示例用作模板http://tympanus.net/Tutorials/WebsiteScrolling/

However I cant work out how to keep the navigation and logo div centred on the page whilst you horizontally scroll. 但是,在水平滚动时,我无法解决如何将导航和徽标div保持在页面中心的问题。 Does anyone know how i can achieve this? 有谁知道我怎么能做到这一点?

You just need to fix the position to the viewport. 您只需要将其位置固定到视口即可。

<div id = "navigation" style="position:fixed">

This will keep the div at what ever location you set it at using top:'500px'; left:'200px;' 这将使div保持在您使用top:'500px'; left:'200px;'设置的位置top:'500px'; left:'200px;' top:'500px'; left:'200px;' etc. 等等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM