What I am trying to do is render my page with a certain element scrolled to the top if the url contains a certain word. I've been able to successfully extract the url with the following:
if(window.location.href.indexOf("Awesome") > -1) {
alert('hey, your url has Awesome in it!')
};
However I am at a crossroads in terms of getting the page to render with a specific element scrolled to the top... Any suggestions?
UPDATE - here is my current logic:
window.addEventListener('load', function(){
(function(){
function goto(id) {
var elem = document.getElementById(id);
window.scrollTo(0, elem.getBoundingClientRect().top);
}
if(window.location.href.indexOf("Awesome") > -1) {
goto('full--stop');
};
})();