V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jame

Apple 产品页头部固定技术

  •  
  •   jame · Apr 24, 2016 · 2434 views
    This topic created in 3655 days ago, the information mentioned may be changed or developed.

    使用 iPhone 浏览产品页时, logo 下面那行在滚动后固定定位,而且很顺滑,这是怎么做到的?求教。

    产品页链接: http://www.apple.com/cn/iphone-6s/

    6 replies    2016-04-24 23:46:24 +08:00
    atan
        1
    atan  
       Apr 24, 2016
    levon
        2
    levon  
       Apr 24, 2016
    我觉得比较人性化的做法是当你要往上滚的时候,头部才显示出来。
    audi
        3
    audi  
       Apr 24, 2016 via iPhone
    页面中的 iPhone 模型才顺滑
    jame
        4
    jame  
    OP
       Apr 24, 2016
    @atan 这个不支持手机。
    @levon 同感。
    atan
        5
    atan  
       Apr 24, 2016
    看了下样式,他用了 position:sticky 这个 css3 属性,因此比较流畅,但是目前只有 firefox 和 safari 支持,所以 chrome , IE 下还是需要 JS 完成,效果就没这么好了
    jame
        6
    jame  
    OP
       Apr 24, 2016
    @atan 看到,谢谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1359 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 23:49 · PVG 07:49 · LAX 16:49 · JFK 19:49
    ♥ Do have faith in what you're doing.