Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Create a fixed side navigation that shows your current scrolling page location


zzlogan

Question

10 answers to this question

Recommended Posts

  • 0
51 minutes ago, zzlogan said:

Site URL: https://pelican-snail-erg5.squarespace.com/

Hi,

Would anyone know what the proper term for the side status bar is shown in the video? 

And is there anyway to replicate that via CSS or existing squarespace plugins?

 

Thanks,

Zack

Í í

 

1 hour ago, zzlogan said:

Site URL: https://pelican-snail-erg5.squarespace.com/

Hi,

Would anyone know what the proper term for the side status bar is shown in the video? 

And is there anyway to replicate that via CSS or existing squarespace plugins?

 

Thanks,

Zack

It called same-page navigation, you can find more info about it here

Creating same-page links in Squarespace ▪️ Launch the Damn Thing!

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
On 7/15/2021 at 10:07 AM, zzlogan said:

@bangank36 would you have any idea of how to do what was done in the video above? 

 

I was looking through the link you sent over and it showing how to click a link on a page and it dropping you down lower in the page.  I need to do that but have a side navigation bar... not sure if that possible to add via css?..   

You mean this kind of navigation right?

image.png.e740f23f8ac4b6f8717afbe6560591ca.png

on 7.0 I noticed mentor template has this feature built-in

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
4 hours ago, zzlogan said:

@bangank36, yes, that is correct, as seen here: https://michelegee.com/ 

 

I'm currently using a 7.1 site, anyway to accomplish that for this? And I think they are using a Squarespace site to do this sidebar same-page navigation.

There is tuts in the launch the damn thing url I sent

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0

@creedon, thanks for looking into it.  I have looked at the video, it is great for the anchor links but, I need more of the functionality of the little bars popping out on a hover that you can then click and it drops you down to the bottom of the page, as seen here: https://michelegee.com/

 

@rwp, I noticed you had an answer on something similar for this post.  Would you have any recommendations on things to try? 

 

 

 

Link to comment
  • 0

I tried this, and it is working

 

/* Style the links inside the sidenav */
#mySidenav a {
  position: absolute; /* Position them relative to the browser window */
  right: 0em; /* Position them outside of the screen */
  //transition: .1s; /* Add transition on hover */
  padding: 10px; /* 15px padding */
  position: fixed;
  width: 100px; /* Set a specific width */
  text-decoration: none; /* Remove underline */
  font-size: 15px;
  color: #ebb646; //#ffad77
  //border-radius: 0 5px 5px 0; /* Rounded corners on the top right and bottom right side */
  z-index: 7990; 
}

#mySidenav a:hover {
  right: .444em; /* On mouse-over, make the elements appear as they should */
}
/* The about link: 20px from the top with a green background */
#supload {
  top: 370px;
  //background-color: #04AA6D;
}
#sos {
  top: 400px;
  //background-color: #2196F3; /* Blue */
}
#govote {
  top: 430px;
  //background-color: #2196F3; /* Blue */
}
#solarstates {
  top: 460px;
  //background-color: #f44336; /* Red */
}
#neuronnectar {
  top: 490px;
  //background-color: #555 /* Light Black */
}
#rdoor {
  top: 520px;
  //background-color: #555 /* Light Black */
}
#aboutme {
  top: 550px;
  //background-color: #555 /* Light Black */
}

@media screen and (max-width:740px){
  #block-yui_3_17_2_1_1632919836480_17663{
  display:none;
}}

html {
    --scroll-behavior: smooth;
    scroll-behavior: smooth;
}

with these code injections

Header

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($){
  $('.header-menu-nav-item a').click(function(){
    $('body').removeClass('header--menu-open');
    $('button.header-burger-btn.burger').click();
  });
})
</script>

Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  // Add smooth scrolling to all links
  $("a").on('click', function(event) {
    // Make sure this.hash has a value before overriding default behavior
    if (this.hash !== "") {
      // Prevent default anchor click behavior
      event.preventDefault();
      // Store hash
      var hash = this.hash;
      // Using jQuery's animate() method to add smooth page scroll
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 100, function(){
        // Add hash (#) to URL when done scrolling (default click behavior)
        window.location.hash = hash;
      });
    } // End if
  });
});
</script>

 

This is working well, only thing is finding a way to change the font color when the text glides over a new background color.  I have tried invert, but it only works with static text, not when I scroll down the page the text just stays the same color.

698537133_ScreenShot2021-10-05at5_16_39AM.thumb.png.5961d0b6849cdf89efe2bdf85734dddf.png

Would anyone know how to change the text color when scroll into a new section?

 

@tuanphan @bangank36 @creedon

Link to comment
  • 0

@zzlogan

There are two ways I can think of too solve this issue. I don't have any specific code for either scenario.

First you could put a background color behind the sidebar itself. That way you wouldn't have to do anything fancy. Just some, hopefully, simple CSS.

The other method that comes to mind would be somewhat tricky and would require Javascript. It might be possible to track the sidebar and detect what background color is behind it and then alter the color of the links.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...