Sha256: f66c97a8c983fab6b78b466ada032801b00d77c42f8fe194e356eebc57a49d70

Contents?: true

Size: 924 Bytes

Versions: 8

Compression:

Stored size: 924 Bytes

Contents

$(document).ready(function(){
  $("#menu-close").click(function(e) {
      e.preventDefault();
      $("#sidebar-wrapper").toggleClass("active");
  });

  // Opens the sidebar menu
  $("#menu-toggle").click(function(e) {
      e.preventDefault();
      $("#sidebar-wrapper").toggleClass("active");
  });

  // Scrolls to the selected menu item on the page
  $(function() {
      $('a[href*=#]:not([href=#])').click(function() {
          if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {

              var target = $(this.hash);
              target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
              if (target.length) {
                  $('html,body').animate({
                      scrollTop: target.offset().top
                  }, 1000);
                  return false;
              }
          }
      });
  });
})

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
frontend-generators-0.2.0 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio/stylish_portfolio.js
frontend-generators-0.1.2 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio/stylish_portfolio.js
frontend-generators-0.1.1 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio/stylish_portfolio.js
frontend-generators-0.1.0 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio/stylish_portfolio.js
frontend-generators-0.0.6 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio/stylish_portfolio.js
frontend-generators-0.0.4 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio.js
frontend-generators-0.0.3 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio.js
frontend-generators-0.0.2 assets/stylish_portfolio/app/assets/javascripts/stylish_portfolio.js