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

              
                <body>

	<!-- #HEADER -->
	<header class="contain-to-grid">

		<!-- #NAVIGATION -->
		<nav class="top-bar" data-topbar data-options="" role="navigation">

			<!-- Top Bar Name -->
			<ul class="title-area">
			
				<li class="name"><h1><a href="#">Fixed Media Player</a></h1></li>
			
			</ul>

		</nav>

	</header> 


	<!-- #ABOUT -->

	<div class="row">

		<!-- About Summary -->
		<section class="medium-7 columns end">

			<div class="about__summary">

				<p>My goal was to build a media player that is fixed to the bottom of the viewport. It should exactly match the resizing that happens with the 'medium-10 medium-centered large-uncentered large-7 columns' setup I have in this section.</p>
        <p>The key to the solution was to mimic the column structure of the footer with the 7-column left div (containing the .media-player__device) and 5-column right div (empty). That is, I contained the row & column in a div called .media-player, which I set as position: fixed, bottom: 0, and width: 100%.</p>
			</div>

		</section>

	</div>





	<!-- #FOOTER -->
	<section class="footer">

		<div class="row">

			<!-- #footer__right -->
			<div class="medium-10 medium-centered large-uncentered large-5 large-push-7 columns">

				<!-- Copyright -->
				<div class="copyright">&copy; 2014 This Website</div>

			</div>


			<!-- #footer__left -->
			<div class="medium-10 medium-centered large-uncentered large-7 large-pull-5 columns">

				<div class="footer__dock"></div>

			</div>

		</div>

	</section>





	<!-- #MEDIA-PLAYER -->
	<section class="media-player">

		<div class="row">

			<!-- #media-player__left -->
			<div class="medium-10 medium-centered large-uncentered large-7 columns">

				<div class="media-player__device">
					Media Player
				</div>

			</div>

			<!-- #media-player__right (invisible placeholder) -->
			<div class="large-5 columns show-for-large-only"></div>

		</div>

	</section>





<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/foundation/js/foundation.min.js"></script>
<script src="js/app.js"></script>





</body>

              
            
!

CSS

              
                @import "bourbon";

//------------------------------------------------------------
//
// #BODY
//
//------------------------------------------------------------


body {
  background: #ccc;
}


.about__summary {
  background: #c1c1c1;
  color: #333;
  padding: rem-calc(15);
  margin-top: rem-calc(50);
  margin-bottom: rem-calc(400);
}





//------------------------------------------------------------
//
// #FOOTER
//
//------------------------------------------------------------


.footer {
  background: #333;

  &__dock {
    background: #ccc;
    font-size: rem-calc(12);
    height: 60px;
  }

}

.copyright {
  color: #777;
  font-size: rem-calc(12);
  margin-bottom: rem-calc(20);
  text-align: center;
  
  // How is it best to vertically align this in the center?
  margin-top: 20px;

  @media #{$large-up} {
    margin-bottom: 0;
  }

}





//------------------------------------------------------------
//
// #MEDIA-PLAYER
//
//------------------------------------------------------------


.media-player {

  // Here is where the magic happens
  position: fixed;
  bottom: 0;
  width: 100%;
	
	&__device {
    background: rgba(0, 0, 0, .8);
    color: #ccc;
    font-size: rem-calc(12);
    height: 60px;
    padding: rem-calc(15);
	}

}
              
            
!

JS

              
                $(document).foundation({
	orbit: {
		animation: 'slide',
		circular: true,
		navigation_arrows: false,
		slide_number: false,
		swipe: true,
		timer: false
	}
});
              
            
!
999px

Console