javascript - HTMLCSS Items disappear when scrolling. - Stack Overflow

If anyone could tell me how this website is achieving the disappearing of the logo once the user starts

If anyone could tell me how this website is achieving the disappearing of the logo once the user starts to scroll that would be much appreciated! If you look at the logo in the upper left, once you start to scroll it disappears. What technique is this called? Is this done with javascript?

/

Thanks in advance!

If anyone could tell me how this website is achieving the disappearing of the logo once the user starts to scroll that would be much appreciated! If you look at the logo in the upper left, once you start to scroll it disappears. What technique is this called? Is this done with javascript?

http://www.studionudge./

Thanks in advance!

Share Improve this question asked May 15, 2012 at 16:26 YoungGuyYoungGuy 3032 gold badges8 silver badges15 bronze badges 1
  • Scroll slowly down. The logo doesn't simply disappear, it just moves up past the top of the screen, just like most of the rest of the content. – Kendall Frey Commented May 15, 2012 at 16:28
Add a ment  | 

3 Answers 3

Reset to default 2

You can simple do by css property fixed.

Eample :

<div id="main">
  Test Content
</div>

<div id="content">
  Add some more content here for result.
</div>

<style type="text/css">
  #main {
    width: 100%;
    height: 60px;
    background: green;
    position: fixed;
    z-index: 1000; /* Z-Index for making this div always on top */
  }

  #content {
    width: 960px; margin:0 auto; position: relative; background: blue;
  }

</style>

No. The logo is placed inside a "normal" container, that scroll with the rest of the page; the menu is instead in a "fixed" one, that does not scroll. Plus, a trick is used to display logo on top of the menu and website content behind it. Very nice effect, I've never seen before.

Basic HTML/CSS code and working example: http://jsfiddle/cs7Nk/ :-)

I believe what is happening, is the header has the property background-attachment set to scroll.

The logo isn't part of the header (it just sits on top with z-index) so it doesn't get the scrolling effect.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744228991a4564150.html

相关推荐

  • javascript - HTMLCSS Items disappear when scrolling. - Stack Overflow

    If anyone could tell me how this website is achieving the disappearing of the logo once the user starts

    8天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信