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>

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>

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

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

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://3g.wnxtjc.wang/template/moban/AQ00625/midnight.jquery.js"></script>
// Start midnight
  // Change this to the correct selector.

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>

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


迅雷彩票【复制黏贴:79hf.com】008彩票 【上盛大娱乐sd7999.com】AB欧博厅【复制网址ds70.com】幸运农场【信誉超好sd8999.com】PP王者电子【复制网址ds13.com】GD电子【6933g.com】复制打开混合过关【到官网3611.com】北京pk【上澳门美高梅mg70.com】彩神 【上澳门银河120668.com】香港六合彩【复制网址sd7999.com】ag电子游戏【信誉极好zs20.com】快乐十分【万象娱乐wx6.com】复制打开3Sing三昇体育【复制打开8165.com】中福彩票【复制网址sd7999.com】环球彩票官网【永久网址3611.com】平安彩票【信誉极好ds13.com】CMD体育【永久网址3611.com】威尼斯娱乐【万象集团wx15.com】复制打开快3【登入鼎盛:ds96.com】OG东方厅【上盛大娱乐sd8999.com】新疆时时彩【sd6777.com】打开送红包秒速时时彩【万象集团wx6.com】复制打开拉菲彩票【信誉极好zs20.com】SG新霸电子〖鼎盛娱乐ds53.com〗NE电子【盛大娱乐sd7999.com】加拿大28【到官网3611.com】超级大乐透【信誉极好zs20.com】33彩票〖官网网址:ds53.com〗BBIN旗舰厅【sd6777.com】复制打开秒速快三官网【钻石彩票www.zs06.com】胜负彩【上鼎盛娱乐ds04.com】荣兴彩票【复制网址851888.com】大赢家彩票 【sd6777.com】打开送红包pk10技巧【永久网址3611.com】20选五【上官网ds53.com】933彩票 〖盛大娱乐sd7999.com〗十分彩【sd7799.com】复制打开快乐赛车【永久网址6933.com】1.5分彩【上澳门美高梅mg70.com】幸运飞艇【万象娱乐wx23.com】复制打开彩53平台【sd6777.com】打开送红包彩票网【复制打开1720nn.com】北京pk【上澳门美高梅mg70.com】pk10开奖结果【到官网3611.com】苹果彩【上官网ds53.com】AB欧博厅【复制网址ds70.com】新利彩票〖鼎盛娱乐ds53.com〗欢乐彩票【上鼎盛娱乐ds53.com】26选5【上盛大娱乐sd7999.com】777彩票〖官网ds53.com〗

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

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

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