Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="WordPress・Google・楽天などWEBに関するサービス、デザインの情報を発信">
    <meta name="keywords" content="WordPress,Google,楽天,WEBデザイン,SEO,コンテンツマーケティング,陸上,ランニング,グルメ">
    <base target="_top">
    <title>メニューデモ | CREAM</title>
  </head>
  <body style="">
    <div id="wrapper" class="transition" >
      <div id="header" class="clearfix">
        <a href="" id="logo">LOGO</a>
        <a href="">
          <img src="http://maerc.me/image/cart.png" class="header_icon_l" alt="買い物かご" title="買い物かご">
        </a>
        <a href="">
          <img src="http://maerc.me/image/search.png" class="header_icon" alt="商品検索" title="商品検索">
        </a>
      </div>
      <ul id="navi" class="clearfix">
        <li><a href="">テキスト</a></li>
        <li><a href="">テキスト</a></li>
        <li><a href="">テキスト</a></li>
        <li><a href="">テキスト</a></li>
      </ul>
    </div>
    <img src="http://maerc.me/image/dogs.jpg" width="100%">
    <img src="http://maerc.me/image/dogs.jpg" width="100%">
  </body>
</html>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
}

.clearfix:after {
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}

.clearfix {
	display: inline-table;
}

html, body {
	width: 100%;
	padding: 0;
	margin: 0;
	background-color: transparent;
	font-family: YakuHanJP, "Yu Gothic", YuGothic, "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "Meiryo UI", メイリオ, Meiryo, sans-serif;
}
#wrapper.absolute {
  position: absolute;
}
#wrapper {
	display: block;
	width: 100%;
	height: auto;
	padding: 0;
	margin: 0;
  top: 300px;
	box-sizing: border-box;
	background-color: #000000;
	opacity: 0.8;
}

#header {
	display: block;
	width: 100%;
	height: auto;
	padding: 10px;
	margin: 0;
	background-color: transparent;
}

#logo {
	display: block;
	width: 50%;
	float: left;
	margin: 0;
	color: #ffffff;
	text-decoration: none;
	font-weight: bold;
	font-size: 18px
}

.header_icon {
	display: block;
	width: 18px;
	float: right;
	margin: 5px 0 0 10px;
}

.header_icon_l {
	display: block;
	width: 22px;
	float: right;
	margin: 5px 0 0 8px;
}

#navi {
	display: block;
	width: 100%;
	height: auto;
	box-sizing: border-box;
	padding: 0;
	margin: 0;
	list-style-type: none;
	background-color: transparent;
	-webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

#navi li {
	display: block;
	width: 25%;
	height: auto;
	text-align: center;
	border-right: #ffffff 1px solid;
	border-bottom: #ffffff 1px solid;
	border-top: #ffffff 1px solid;
	float: left;
	background-color: transparent;
}

#navi li:last-child {
	border-right: none;
}

#navi li a {
	display: block;
	width: 100%;
	height: 100%;
	font-size: 12px;
	color: #ffffff;
	text-decoration: none;
	padding: 7px 0 8px 0;
	background-color: transparent;
}


#navi li a:link {
	color: #ffffff;
	text-decoration: none;
}

#navi li a:visited {
	color: #ffffff;
	text-decoration: none;
}

#navi li a:hover {
	color: #ffffff;
	text-decoration: none;
}

#navi li a:active {
	color: #ffffff;
	text-decoration: none;
}

.clear {
	clear: both;
}

              
            
!

JS

              
                (function(){
//backscrollMenu
function backscrollMenu(){
	var styleElement = document.createElement('style');
	var cssStyle = '#btn2 span { line-height: 9999px; overflow: hidden; background-image: url(https://www.rakuten.ne.jp/gold/dondon/rms_sp/images/menu.svg) !important; background-size: contain!important; background-position: top right !important; z-index: 0; position: absolute; top: 10px; right: 10px; display: block; width: 20px; height: 20px; } #topFuncShopPopup > ul.boxPJ > li:nth-child(1) { transform: translate3d(0, 0, 0); } #wrapper { position: fixed; z-index: 9999; top: 300px; left: 0; width: 100%; transform: translate3d(0, 0, 0); }';
	if((/crios/.test(window.navigator.userAgent.toLowerCase())) || (/Android/.test(window.navigator.userAgent))){
		var cssElement =
		cssStyle +
		'.transition { transition: all 0.04s; }';
	}else {
		var cssElement =
		cssStyle +
		'.transition { transition: all 0.2s; } #wrapper { -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden; visibility: visible; }';
	}
	styleElement.innerHTML = cssElement;
	var divElement = document.createElement('div');
	var miscElement = '<div id="misc" style="position: fixed; color: rgba(255, 255, 255, 0.01);">-</div>';
	divElement.innerHTML = miscElement;
	var bodyElement = document.getElementsByTagName('body')[0];
	bodyElement.appendChild(styleElement);
	bodyElement.appendChild(divElement);
	var menuWrap = document.getElementById("wrapper");
	var menuHeight = menuWrap.clientHeight;
	var before = 0;
	window.addEventListener("scroll", function(){
			var after = window.pageYOffset;
			if(after >= menuHeight) {
					
			} else {
					menuWrap.classList.remove("transition");
			}
      // 特定の高さまでナビゲーションバーを表示
			if(after > 1200) {
					if(after > before) {
            menuWrap.classList.add("transition");
							menuWrap.style.top = "-" + menuHeight + "px";
          }else {
							menuWrap.style.top = "0";
					}
      } else if (after < 300) {
       menuWrap.classList.remove("transition");menuWrap.classList.add("absolute");
        menuWrap.style.top = 300 + "px";
			} else {
					//menuWrap.style.top = "-" + menuHeight + "px";
        menuWrap.classList.remove("absolute");
					menuWrap.style.top = "0"; // ナビゲーションバーを表示
			}
			before = after;
	});
	var menuPopup = document.getElementById('menuPopUp');
	menuPopup.setAttribute("style","transition: transform 0.35s ease-in-out; z-index: 9999999;");
}
if(document.getElementById('wrapper')){
backscrollMenu();
}
})();
              
            
!
999px

Console