Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                	<div id="vid-1" class="show">
		<video src="https://kinocolumn.com/cael_wp/wp-content/uploads/2022/03/UntitledGooseGame-Mini-02_1.mp4" controls muted playsinline autoplay></video>
		<button class="next">Next</button>
	</div>
	<div id="vid-2">
		<video src="https://kinocolumn.com/cael_wp/wp-content/uploads/2022/03/UntitledGooseGame-Mini-02_1.mp4" controls muted playsinline preload="none"></video>
		<button class="next">Next</button>
	</div>
	<div id="vid-3">
		<video src="https://kinocolumn.com/cael_wp/wp-content/uploads/2022/03/UntitledGooseGame-Mini-02_1.mp4" controls muted playsinline reload="none"></video>
		<button class="next">Next</button>
	</div>

	<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js' integrity='sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==' crossorigin='anonymous'></script>
	<script src="js/main.js"></script>
              
            
!

CSS

              
                [id^="vid-"] {
  display: none;
  width: 400px;
  background: #eee;
  text-align: center;
  padding: 20px 0;
}

[id^="vid-"] video {
  width: 300px;
}

[id^="vid-"] button {
  background: pink;
  border: none;
  font-size: 20px;
  margin: 20px 30px;
  padding: 0.5em 2em;
}

[id^="vid-"] button:hover {
  cursor: pointer;
}

[id^="vid-"].show {
  display: block;
}
/*# sourceMappingURL=style.css.map */
              
            
!

JS

              
                (function() {
    'use strict';

    let vids = $('video');//<video></video>
    let playBtns = $('button.next'); //<button class="next"></button>

    playBtns.click(function (e) {
        let curVid = $(this).siblings('video').get(0);
        let next = $(this).parent().next(); //次の要素
        let nextVid = next.children('video').get(0); //次の要素内のvideoタグをDOMで取得

        curVid.pause();
        next.show(); //次の要素を表示
        $("html,body").animate({scrollTop:next.offset().top}); //次の要素へスクロール
        nextVid.play(); //動画を再生
    });

})();

              
            
!
999px

Console