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

              
                #wrapper
  nav#menu.menu
    ul.row-centered
      li.link-home
        a(href="#section-1") Section 1
      li.link-empresa
        a(href="#section-2") Section 2
      li.link-tecnologias
        a(href="#section-3") Section 3
      li.link-cases
        a(href="#section-4") Section 4
      li.link-contato
        a(href="#section-5") Section 5
  
  section#section-1
    h2 Title Section 1
  section#section-2
    h2 Title Section 2
  section#section-3
    h2 Title Section 3
  section#section-4
    h2 Title Section 4
  section#section-5
    h2 Title Section 5
  
              
            
!

CSS

              
                #wrapper
  padding-top 90px
  
  section
    margin 600px 200px
    
   h2
     font-size 30px

  #menu
      width 100%
      background-color #2a2a2a
      border-top 4px solid #ff6600
      z-index 990
      display block

    #menu ul.row-centered
      width 100%
      text-align center
      padding 0

    #menu ul li
      padding 23px
      display inline-block
      col(3/6)
      margin 0
      border-left 2px solid #000
      cursor pointer
      &:hover a
        color #ff6600

    .icon-play
      col(1/3)
      width 12% !important
      padding 0 !important
      border-left 0 !important

    .icon-play a
      sprite($icon_playlearn)
      display block
      margin: 0 auto
      opacity 0.8
      &:hover
        opacity 1

    #menu ul li a
      text-transform uppercase
      color #fff
      font-size 18px
      font-family 'Hind Guntur', sans-serif
      font-weight 400
      &:hover
        color #ff6600
      +below(1157px)
        font-size 14px


    .fixar
      position fixed !important
      top 0 !important
      left 0 !important
              
            
!

JS

              
                $(document).ready(function() {


var offset = $('#menu').offset().top;
	var $meuMenu = $('#menu');
	$(document).on('scroll', function () {
	    if (offset <= $(window).scrollTop()) {
	        $meuMenu.addClass('fixar');
	    } else {
	        $meuMenu.removeClass('fixar');
	    }
	});

$(function(){

		var wrapper = $("#wrapper"),
    $menu = $("#menu");

		$menu.on("click","li", function(){
			var $this = $(this),
					href = $(this).find("a").attr("href"),
		      topY = $(href).offset().top,
					extraOffset = $menu.hasClass('fixar') ? 75 : 0;

		    TweenLite.to(window, 2, { scrollTo: { y: topY - extraOffset, x: 0 }, ease: Cubic.easeIn });

		  return false;
		});

	});
});
              
            
!
999px

Console