Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.9gag.com/" rel="nofollow">9gag.com</a> also uses <code>position:fixed;</code> for the header, but in your case, it's making it <code>position:fixed !important</code> is the solution, since it's overridden below where you've put it on your site (at the top).</p> <p>CSS:</p> <pre><code>#netbar{position:fixed !important;} </code></pre> <p><a href="http://jsfiddle.net/mDk9Y/1/show" rel="nofollow">Live demo</a> | <a href="http://jsfiddle.net/mDk9Y/1/" rel="nofollow">Demo source</a></p> <p><strong>Edit:</strong></p> <p>The easiest way to achieve this without sacrificing the suckerfish position is to use jQuery, as you've mentioned</p> <pre><code>$(document).ready(function () { $(window).scroll(function () { $("#enjin-bar").css({ "top": Math.max($('body').scrollTop(), $('html').scrollTop()) + 4 }); $("#netbar").css({ "top": Math.max($('body').scrollTop(), $('html').scrollTop()) }); }); }); </code></pre> <p><a href="http://jsfiddle.net/Ryrez/show" rel="nofollow">Live demo</a> | <a href="http://jsfiddle.net/Ryrez/" rel="nofollow">Demo source</a></p> <p>It works, however it's incredibly glitchy; just set netbar to absolute again by removing the <code>#netbar{position:fixed !important;}</code> line from your site</p> <p>Or if you're willing to sacrifice the suckereye's position for a little less glitchy-ness, use this code instead:</p> <pre><code>$(document).ready(function () { $(window).scroll(function () { $("#enjin-bar").css({ "top": Math.max($('body').scrollTop(), $('html').scrollTop()) + 4 }); }); }); </code></pre> <p>The enjin-bar is not a part of the netbar and that's the main reason why it doesn't follow the netbar when you scroll, so the easiest way to bypass this is to use jQuery</p> <p><a href="http://jsfiddle.net/TzZJ8/show" rel="nofollow">Live demo</a> | <a href="http://jsfiddle.net/TzZJ8/" rel="nofollow">Demo source</a></p> <p><strong>Edit2:</strong></p> <p>Replace the code from the pastie to the one below:</p> <pre><code>&lt;div id="netbar"&gt; &lt;div id="discover" role="directory"&gt; &lt;ul&gt; &lt;li class="suckerfish"&gt; &lt;span class="sitelogo"&gt;LinkyCraft&lt;/span&gt; &lt;ul class="section-drop"&gt; &lt;li class="link-two"&gt;&lt;a href="http://www.linkycraft.net/servers"&gt;Server Status&lt;/a&gt;&lt;/li&gt; &lt;li class="link-three"&gt;&lt;a href="http://www.linkycraft.net/home"&gt;Survival Home&lt;/a&gt; &lt;li class="link-five"&gt;&lt;a href="http://www.monlotron.enjin.com/"&gt;Our Designer&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;style&gt; div#netbar a { color: #DEE3E6; } div#netbar a:hover { color: #FFFFFF; } div#netbar li { float: left; margin: 0; position: relative; } div#netbar &gt; a { border-right: 1px solid #333333; display: block; float: left; line-height: 29px; padding: 0 10px; } div#netbar &gt; a:hover { background: none repeat scroll 0 0 #222222; } div#netbar .suckerfish { z-index: 9998; } div#netbar .suckerfish &gt; .section-drop { background-color: #222222; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; border-top: medium none; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); position: absolute; z-index: 2; float: left; } div#netbar .suckerfish &gt; a, div#netbar .suckerfish &gt; span { display: block; font-size: 12px; line-height: 12px; padding: 8px 16px 9px 10px; white-space: nowrap; } div#netbar .suckerfish ul li { float: none !important; margin: 0; width: auto; } div#netbar .suckerfish:hover { background-color: #222222; } .suckerfish .section-drop{ left: -9999px; } div#netbar { border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; -webkit-border-radius: 0 0 3px 3px; background:-moz-linear-gradient(top,#4d4d4d 0,#343434 100%); background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#4d4d4d),color-stop(100%,#343434)); background:-webkit-linear-gradient(top,#4d4d4d 0,#343434 100%); background:-o-linear-gradient(top,#4d4d4d 0,#343434 100%); background:-ms-linear-gradient(top,#4d4d4d 0,#343434 100%); background:linear-gradient(top,#4d4d4d 0,#343434 100%); -moz-box-shadow:inset 0 0 1px #666,1px 1px 2px rgba(0,0,0,.65); -webkit-box-shadow:inset 0 0 1px #666,1px 1px 2px rgba(0,0,0,.65); box-shadow:inset 0 0 1px #666,1px 1px 2px rgba(0,0,0,.65); color:#dee3e6; height:28px; padding:0; position:absolute; width:4000px; left:-1460px; top: 0; z-index:4; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100.01%; font-family: inherit; vertical-align: baseline; outline: 0; } div#netbar li.suckerfish { position: relative; left: 1460px; } #enjin-bar {margin-left: 175px;} div#netbar .sitelogo { background: url("http://files.enjin.com/93809/LinkyCraft/Images/Headers/Netbar.png") no-repeat scroll 6px 1px transparent; text-indent: -9999px; width: 150px; } #enjin-bar { z-index: 25; } div#enjin-bar &gt; div.left &gt; a:first-child { display: none; } #netbar li { list-style: none outside none; } div#netbar a { color: #DEE3E6; } div#netbar .suckerfish { z-index: 9998; } div#netbar .suckerfish ul li { float: none !important; margin: 0; width: auto; } div#netbar .suckerfish:hover { background-color: #222222; } div#netbar .suckerfish &gt; ul li a { display: block; font-size: 12px; line-height: 12px; padding: 6px 12px; white-space: nowrap; } div#netbar .suckerfish &gt; ul li a:hover { background-color: #111111; } div#netbar .suckerfish &gt; ul li:last-child a { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; } div#netbar .suckerfish &gt; span:after, div#netbar .suckerfish &gt; a:after { border-color: Silver transparent transparent; border-right: 3px dashed transparent; border-style: solid dashed dashed; border-width: 3px 3px 0; content: ""; display: block; height: 0; line-height: 0; padding-top: 1px; position: absolute; right: 6px; top: 13px; width: 0; } div#netbar div#discover { float: left; height: 28px; } div#netbar div#discover ul &gt; li { float: left; height: 28px; line-height: 28px; position: relative; } div#netbar div.help-links { border-right: 1px solid #333333; float: left; } div#netbar div#discover ul li span { border-right: 1px solid #333333; } div#netbar div#discover ul li span:hover { color: #FFFFFF; cursor: default; } div#netbar div#discover li.suckerfish ul { top: 27px; width: 200px; padding-left: 0; } div#netbar div#discover li.suckerfish ul li a { background-position: left center; background-repeat: no-repeat; padding-left: 30px; } .suckerfish:hover .section-drop{ left: 0px; } &lt;/style&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $(window).scroll(function () { $("#enjin-bar").css({ "top": Math.max($('body').scrollTop(), $('html').scrollTop()) + 4 }); $("#netbar").css({ "top": Math.max($('body').scrollTop(), $('html').scrollTop()) }); }); }); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-37359442-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload