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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="relative">
<div class="horizontal" id="map-wrapper">
  <svg xmlns="http://www.w3.org/2000/svg"
		   xmlns:xlink="http://www.w3.org/1999/xlink"
			style="position:absolute;width:100%;height:100%;z-index:0"> <path id="solid-line" fill="none" stroke="white" stroke-width="1px"/>
        <animate attributeType="XML" attributeName="bezcurve" from="-200" to="220"
        dur="10s" repeatCount="indefinite"/>
					</svg>
 <div class ="horizontal">
    <div class="point start">
      <button>START</button>
    </div>
    <div class="point one">
      <button>One</button>
    </div>
    <div class="point two">
      <button>Two</button>
    </div>
    <div class="point three">
      <button>Three</button>
    </div>
    <div class="point four">
      <button>Four</button>
    </div>
    <div class="point five">
      <button>Five</button>
    </div>
  </div>
  
  <div class="end"></div>
   <div class="end-2"></div>
  </div>
              
            
!

CSS

              
                
body {
  background: #f4f4f4;
  font-family: 'Open Sans', sans-serif;
  margin: 0 auto;
  padding: 0;
  min-height:100%;
  overflow: hidden;
}

.relative {
/*   position: relative; */
}

#map-wrapper div {
/*   max-width: 900px; */
  margin: 0 auto;
  padding: 4px 30px;
  
  
}

#map-wrapper div:nth-child(even) button {
  float: right;
  background: red;
  visibility: hidden;

}

.start button {
/*   text-align: left;
  position: absolute; */
}

.horizontal {
/*  height: 100vh; */
/*  max-width: 2px; */
 min-width: 100vw;
 list-style: none;
 background-color: black;
 display: -webkit-box;
 display: -moz-box;
 display: -ms-flexbox;
 display: -webkit-flex;
 display: flex;
 justify-content: space-around;
 flex-direction: row;
}

.point {
  width: 15%;
 height: 30px;
  -moz-flex: 1 0 auto;
  -webkit-flex: 1 0 auto;
  flex: 1 0 auto;
  visibility: hidden;
}

.end {
/*   position: relative; */
}
              
            
!

JS

              
                var trail = $('#solid-line');
// var animated = $('#animated-line');

// beginning coordinates for the solid line
var startx = $( ".start button" ).position().left;
var starty = $( ".start button" ).position().top;
var path = 'M ' + startx  + ',' + starty;
var bezcurve = 150;
// for each button, find the coordinates and add them to the SVG
$( "button" ).each(function( index ) {
  var currentX = $(this).position().left;
  var currentY = $(this).position().top;
  
  if( 0 === index ) {
  // C needs two sets of coordinates to make a quadratic Bezier curve
    path += ' C' + ((startx)+150) + ',-20 '+((startx)+20)+',80 ';

  } else {
    // write the end point of the line now we know it
   path+= currentX +','+currentY+' ';
   
  if (index % 2 === 0) {
      // even, map marker on left
      path += 'M'+ currentX+','+currentY;
     // curve
      path += ' C' + (currentX+80) + ',-30 ' + (currentX+80) + ',90 ';
    } else {
      // odd, map marker on right 
      path += 'M'+ currentX+','+currentY;
     // curve
      path += ' C' + (currentX+130) + ',-30 ' + (currentX+10) + ',180 ';
    }
  }

});

trail.attr('d', path);

// $("svg").clone().appendTo("body");
// $("svg").clone().appendTo("body");
// $("svg").clone().appendTo("body");

$(".horizontal").clone().appendTo("body");
$(".horizontal").clone().appendTo("body");




              
            
!
999px

Console