respond icon indicating copy to clipboard operation
respond copied to clipboard

Menu creation for single page websites

Open suppefisk opened this issue 7 years ago • 2 comments
trafficstars

I think Respond CMS would be a great tool for editing single page websites. Have you considered adding functionality to support this? I guess it would require the option to add anchors as well as to create menu items from anchors in the home page.

suppefisk avatar Nov 26 '17 10:11 suppefisk

I agree. This is definitely possible in Respond today. You can add menu items with hash (#) anchors and you can set the ID on blocks or any element of the page (via the cog icon). It might be good to create a theme and some documentation around it though. I will work on that and update this issue.

madoublet avatar Nov 26 '17 21:11 madoublet

I've done this in Respond 5 and it works well. I added a little bit of jQuery that makes it scroll to the target anchor smoothly. Maybe this will be useful for the theme:

/* Animate scrolling to #anchors */
$("a[href^='#']").on('click', function(event) {

  var target;
  target = this.hash;

  event.preventDefault();


  var navOffset;
  navOffset = $('.navbar-header').height();
  /* console.log(navOffset); */
  
  return $('html, body').animate({
    scrollTop: $(this.hash).offset().top - navOffset
  }, 300, function() {
    return window.history.pushState(null, null, target);
  });
});

axis80 avatar Dec 02 '17 02:12 axis80