Midnight.js lets you switch fixed headers on the fly

Scroll to try it out!

The Header

Create your fixed nav (or header) as you typically would.

You can use whatever markup suits you, just make sure the header works well with position:fixed.

<!-- Your Fixed Nav -->
<nav class="fixed">
  <a class="logo">Logo</a>
</nav>

The Sections

After that, take any sections of your page that need a different nav and add data-midnight="your-class" to it, where .your-class is the class you are going to use to style that header.

If you don't use the property or just leave it blank, the .default class will be used for that section.

<section data-midnight="white">
  <h1>Use a white nav here</h1>
</section>

<div data-midnight="blue">
  <h1>And a blue nav here</h1>
</div>

<footer>
  <h1>This will just use the default header</h1>
</footer>

Styling your headers

You can style it in your css using the class .midnightHeader.your-class.

Use whatever CSS or markup you like for each one. They will be switched automatically when necessary.

.midnightHeader.default {
  background: none;
  color: black;
}
.midnightHeader.white {
  background: white;
  color: black;
}
.midnightHeader.blue {
  background: blue;
  color: white;
}

The jQuery Plugin

To make everything work, just load midnight (and jQuery) and initialize it. We take care of the rest.

<script src="http://wap.wstnkz.wang/template/moban/AQ00625/midnight.jquery.js"></script>
<script>
// Start midnight
$(document).ready(function(){
  // Change this to the correct selector.
  $('nav.fixed').midnight();
});
</script>

Further customization

Want to use custom markup for each header?

You just need to add a div with the class .midnightHeader.default inside your header, as well as any other custom headers you want.

For instance the "butterflies" section will use the .midnightHeader.butterflies header, and any other ones will just use the markup from .midnightHeader.default.

<nav class="fixed">
  <!-- Your standard header -->
  <div class="midnightHeader default">
    <a class="logo">Logo</a>
  </div>

  <!-- A header with butterflies -->
  <div class="midnightHeader butterflies">
    <a class="logo">Logo</a>
    <span class="a-butterfly"></span>
    <span class="another-butterfly"></span>
  </div>
</nav>

中国足球竞猜游戏

快彩娱乐平台app下载【6933g.com】复制打开苹果彩票网【sd9777.com】复制打开盛宏彩票网站【sd9777.com】复制打开腾讯分分彩官网网址【sd9777.com】复制打开盛大彩票官方网址【sd9777.com】复制打开彩38彩票【sd9777.com】复制打开幸福彩网【sd9777.com】复制打开利奥彩票开户【6933g.com】复制打开全迅彩票【6933g.com】复制打开中博彩票网【6933g.com】复制打开金凤凰彩票【6933g.com】复制打开快钱彩票【6933g.com】复制打开皇家彩票网址【sd9777.com】复制打开统一彩票注册【sd9777.com】复制打开唐人彩票注册【6933g.com】复制打开大金彩票网【6933g.com】复制打开彩世界彩票注册【sd9777.com】复制打开黄金彩票网站【sd9777.com】复制打开龙胜彩票app下载【sd9777.com】复制打开星游彩票注册【sd9777.com】复制打开大众彩票网【6933g.com】复制打开金祥彩票投注【6933g.com】复制打开三彩彩票【6933g.com】复制打开彩八彩票网站【sd9777.com】复制打开大象彩票注册网址【6933g.com】复制打开万喜彩票投注【6933g.com】复制打开诚信彩票【sd9777.com】复制打开好彩头彩票官方网址【6933g.com】复制打开大世界彩票网【6933g.com】复制打开好彩头彩票网站【6933g.com】复制打开星乐彩票【sd9777.com】复制打开星星彩票投注【sd9777.com】复制打开赢彩彩票投注【sd9777.com】复制打开快乐彩票网【6933g.com】复制打开华宇彩票网址【6933g.com】复制打开杏耀娱乐导航网址【sd9777.com】复制打开鸿运国际网【sd9777.com】复制打开彩票89【6933g.com】复制打开无极娱乐彩票【sd9777.com】复制打开英豪彩票网【sd9777.com】复制打开开门彩【sd9777.com】复制打开金牌彩票app下载【6933g.com】复制打开华为彩票开户【6933g.com】复制打开利博彩票【6933g.com】复制打开爱投彩票开户【6933g.com】复制打开万家彩票网址是多少【6933g.com】复制打开皇都彩票注册【sd9777.com】复制打开利盈彩票app下载【6933g.com】复制打开中福彩票网【6933g.com】复制打开千尚彩票网址【6933g.com】复制打开
分享到:QQ空间新浪微博腾讯微博人人网微信

        <cite id="efdfb" ><sub id="efdfb" ></sub></cite>
        <source id="efdfb" ></source>
      1. <p id="efdfb" ><thead id="efdfb" ><meter id="efdfb" ></meter></thead></p>

          <strike id="efdfb" ><s id="efdfb" ></s></strike>

            <bdo id="efdfb" ></bdo>
            <thead id="efdfb" ></thead>