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

              
                <!-- Pull in Navigation bar v1. Modified code for Vidyard Players by Chris Broughton. Aug 2020-->
<div id="menu-bar" style="position: fixed; width: 250px; transition: all 300ms ease; height: 100%; top:0px; right: 0px;">
  <div class="handle"><i class="fas fa-chevron-left"></i>NAV</div>
  <h3> Video Navigation </h3>
  <a onclick="jumpToSecond(0)">Part 1</a>
  <a onclick="jumpToSecond(10)">Part 2</a>
  <a onclick="jumpToSecond(20)">Part 3</a>
  <a onclick="jumpToSecond(30)">Part 4</a>
  <a onclick="jumpToSecond(40)">Part 5</a>
  <a onclick="jumpToSecond(50)">Part 6</a> </div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"><style>
  *{box-sizing: content-box; font-size:14px; font-family:sans-serif}i{color:white;font-size:20px;padding:0px 5px}#menu-bar{background-color: rgba(255,255,255,0.8); color: #fff; z-index: 1002;}.left-shadow-overlay{box-shadow: 10px 0 15px 10px #585858;}#menu-bar h3{background-color: rgba(0,0,0,0.8); font-size: 5vw; padding: 9px; margin: 0; font-weight: 300; font-family:sans-serif; height:19px; text-align: center;}#menu-bar a{border-bottom: 1px solid #D8D8D8; padding: 1vw; display: block; color: #424242; font-size: 4vw; font-weight: 300; text-decoration: none; font-family:sans-serif;}#menu-bar a:hover{background-color: #fff;}#menu-bar .handle{font-family: sans-serif;display: block;background-color: rgba(0,0,0,0.6);left: -28px;padding: 2px;position: absolute;top: 0px;width: 25px;height: 33px;cursor: pointer;font-size: 12px;}.side-panel{background-color: #E6E6E6; padding: 10px;}.side-panel-left{box-shadow: -5px 0 15px -6px #585858 inset;}.side-panel-left-overlay{box-shadow: -10px 0 15px 10px #585858;}.side-panel-right{box-shadow: 5px 0 15px -6px #585858 inset;}.jumbotron{margin-bottom: 0px;}a{cursor:pointer;}#text{font-family:sans-serif;}
</style>
<script>
  $(document).ready(function(){var slider=$("#menu-bar").slideReveal({width: 250, position: "right", speed: 300, trigger: $(".handle, a"), shown: function(obj){obj.find(".handle").html('<i class="fas fa-chevron-right"></i>NAV'); obj.addClass("left-shadow-overlay");}, hidden: function(obj){obj.find(".handle").html('<i class="fas fa-chevron-left"></i>NAV'); obj.removeClass("left-shadow-overlay");}});});
                                      /*! slidereveal - v1.1.1 - 2016-03-04
                                      * https://github.com/nnattawat/slidereveal
                                      * Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */
  (function ($) {
  // Private attributes and method
  var getPadding = function($el, side) {
  var padding = $el.css('padding-' + side);
  return padding ? +padding.substring(0, padding.length - 2) : 0;
  };
  var sidePosition = function($el) {
  var paddingLeft = getPadding($el, 'left');
  var paddingRight = getPadding($el, 'right');
  return ($el.width() + paddingLeft + paddingRight) + "px";
  };
   var SlideReveal = function($el, options) {
                // Define default setting
                var setting = {
                width: 250,
                push: true,
                position: "left",
                speed: 300, //ms
                trigger: undefined,
                autoEscape: true,
                show: function(){},
                shown: function(){},
                hidden: function(){},
                hide: function(){},
                top: 0,
                overlay: false,
                "zIndex": 1049,
                overlayColor: 'rgba(0,0,0,0.5)'
                };
                // Attributes
      this.setting = $.extend(setting, options);
    this.element = $el;
    this.init();
    };
  
    // Public methods
    $.extend(SlideReveal.prototype, {
    init: function() {
    var self = this;
    var setting = this.setting;
    var $el = this.element;
    var transition = "all ease " + setting.speed + "ms";
    $el.css({ position: "fixed",width: setting.width, transition: transition,height: "100%",top: setting.top
}).css(setting.position, "-" + sidePosition($el)); if (setting.overlay) {$el.css('z-index', setting.zIndex);
$("body").prepend("<div class='slide-reveal-overlay'></div>"); $(".slide-reveal-overlay") .hide() .css({ position: 'fixed', top: 0, left: 0, height: '100%',  width: '100%', 'z-index': setting.zIndex - 1,'background-color': setting.overlayColor, }).click(function() { self.hide(); }); }
  
                        // Add close stage
                        $el.data("slide-reveal", false);
  
                        if (setting.push){
                        $("body").css({
                        position: "relative",
                        "overflow-x": "hidden",
                        transition: transition,
                        left: "0px"
                        });
                         }
                         // Attach trigger using click event
                        if (setting.trigger && setting.trigger.length > 0) {
                        setting.trigger.on('click.slideReveal', function() {
                        if (!$el.data("slide-reveal")) { // Show
                        self.show();
                         } else { // Hide
                        self.hide();
                                                                                        }
                                                                                      });
                                                                                    }
  
            // Bind hide event to ESC
            if (setting.autoEscape) {
            $(document).on('keydown.slideReveal', function(e) {
            if ($('input:focus, textarea:focus').length === 0) {
            if (e.keyCode === 27 && $el.data("slide-reveal")) { // ESC
            self.hide();
            }
            }
            });
            }
            },
            show: function(triggerEvents) {
            var setting = this.setting;
            var $el = this.element;
            // trigger show() method
            if (triggerEvents === undefined || triggerEvents) { setting.show($el); }
             // show overlay
            if (setting.overlay) {
            $(".slide-reveal-overlay").show();
            }
// slide the panel
$el.css(setting.position, "0px");
if (setting.push) {
if (setting.position === "left") {
 $("body").css("left", sidePosition($el));
} else {
$("body").css("left", "-" + sidePosition($el));} }$el.data("slide-reveal", true);
// trigger shown() method
if (triggerEvents === undefined || triggerEvents) {
setTimeout(function() {
setting.shown($el);
}, setting.speed);}},
hide: function(triggerEvents) {
var setting = this.setting;var $el = this.element;
  // trigger hide() method
if (triggerEvents === undefined || triggerEvents) { setting.hide($el); }
// hide the panel
if (setting.push) {
$("body").css("left", "0px");}$el.css(setting.position, "-" + sidePosition($el));$el.data("slide-reveal", false);
 // trigger hidden() method
if (triggerEvents === undefined || triggerEvents) {
setTimeout(function(){
// hide overlay
if (setting.overlay) {                                                                                  $(".slide-reveal-overlay").hide();
  }
setting.hidden($el);
 }, setting.speed);
}},
toggle: function(triggerEvents) {
var $el = this.element;
if ($el.data('slide-reveal')) {
this.hide(triggerEvents);
} else {
this.show(triggerEvents);}}});
// jQuery collection methods
 $.fn.slideReveal = function (options, triggerEvents) {
if (options !== undefined && typeof(options) === "string") {
this.each(function() {
var slideReveal = $(this).data('slide-reveal-model');
if (options === "show") {
slideReveal.show(triggerEvents);
} else if (options === "hide") {                                                                       slideReveal.hide(triggerEvents);
} else if (options === 'toggle') {
slideReveal.toggle(triggerEvents); }});} else { this.each(function() {
if ($(this).data('slide-reveal-model')) {
$(this).data('slide-reveal-model').remove();
 }
 $(this).data('slide-reveal-model', new SlideReveal($(this), options)); }); } return this;}; }(jQuery));
</script>
<script type="text/javascript">
  function jumpToSecond(second) {
  
                                                               var ctaId=window.frameElement.id.split('_')[1];
                                                               var playerId=window.frameElement.src.split('/');
                                                               playerId=playerId[playerId.length-3];
                                                               var playerData= {
                                                               uuid: playerId, event: 'seek', position: second
                                                               }
                                                               ;
 window.parent.postMessage(JSON.stringify(playerData), '*');}
</script>
<script type="text/javascript">
  function jumpToVideo(chapter_index) {API.closeCta({ disablePlay: true });
API.playChapter({ chapter_index: chapter_index });}
</script>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console