Pen Settings



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


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


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.


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.


                <div class="page-top">
  <a href="#header" class="page-top_link"></a>

<div class="container">
  <footer class="footer">


                /* ページトップ
============================== */
.page-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  transition: 0.5s;

.page-top_link {
  position: relative;
  display: block;
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background-color: #cccccc;

.page-top_link:before {
  content: "";
  display: block;
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;

.is-hidden {
  visibility: hidden;
  opacity: 0;

/* その他
============================== */
main {
  height: 500px;
  padding: 20px;
  text-align: center;

.footer {
  height: 100px;
  background-color: #444;
  padding: 20px;
  color: #fff;
  text-align: center;



                jQuery(function($) {

var footer = $('.footer').innerHeight(); // footerの高さを取得

window.onscroll = function () {
  var point = window.pageYOffset; // 現在のスクロール地点 
  var docHeight = $(document).height(); // ドキュメントの高さ
  var dispHeight = $(window).height(); // 表示領域の高さ

  if(point > docHeight-dispHeight-footer){ // スクロール地点>ドキュメントの高さ-表示領域-footerの高さ
    $('.page-top').addClass('is-hidden'); //footerより下にスクロールしたらis-hiddenを追加
    $('.page-top').removeClass('is-hidden'); //footerより上にスクロールしたらis-hiddenを削除