Scrolling to most recent reply in topic

Related:
Create New Tag

3/23/2018 1:54 PM
Edited Date/Time: 3/23/2018 1:55 PM

When you click the link to go to the most recent reply on a topic, it loads, scrolled down to just below the post you want to see. It scrolls down by 118px too much because it's trying to align the top of the post's div to the top of the browser(which is behind the navbar). So, the page loads like this when you try to go to the most recent post:
Photo

Could something like this be added to the site's javascript to fix this?:

var regex = /post_\d\d\d\d/; //This is the regexp for the url post # eg.#post_1234567
var found = regex.exec( window.location.hash ); //checks window location for regex

if ( found !== null ) { //if something's found
    scrollBy(0, -118); //scroll up by 118px
}


The above does work, you can check it in a browser console. It's pretty quick and dirty but I think it should be fairly easy to clean up and implement.

Thanks! smile

|

My Sunday Soundwave V3 Build
Insta: @p.gibbons

"You can't educate pork"
- grumpySteve

"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!""
- Hunter S. Thompson

3/23/2018 3:56 PM

Thanks for pointing this out. I'll get it to our to-do list.

|

3/23/2018 7:06 PM

VitalBrad wrote:

Thanks for pointing this out. I'll get it to our to-do list.

Sick! Thanks for everything you guys do! smile

|

My Sunday Soundwave V3 Build
Insta: @p.gibbons

"You can't educate pork"
- grumpySteve

"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!""
- Hunter S. Thompson

3/28/2018 11:50 AM

Fixed! Thanks guys! smile

Neat way of doing it too, wouldn't have thought of it. Props!

|

My Sunday Soundwave V3 Build
Insta: @p.gibbons

"You can't educate pork"
- grumpySteve

"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!""
- Hunter S. Thompson