// hashtag_and_a_bit.js // RJM Programming // November, 2021 // Help out Hashtag Position Less a Bit var firstlfh=''; var dgbiv='-40'; function lfh() { if (1 == 1) { var thish=('' + location.hash); if (thish != firstlfh) { firstlfh=thish; //alert(thish); if (firstlfh.split('#').length > 2) { if (firstlfh.split('#andabit').length == 2) { window.scroll(0, 0); var rect=document.getElementById(firstlfh.split('#')[1].split('#')[0]).getBoundingClientRect(); if (('' + rect.top) != '') { var newtop=eval(('' + rect.y)); //y)); newtop+=eval('' + dgbiv); //document.getElementById('i1').value); //window.scroll(0, newtop); //alert(eval(('' + rect.x))); if (document.getElementById('abottomp')) { if (document.getElementById('abottomn')) { if (('' + document.getElementById('abottomp').href).trim() != '' && ('' + document.getElementById('abottomp').href).length == ('' + document.getElementById('abottomn').href).length) { //document.getElementById('abottomp').href+='#upthetop'; console.log('OopS ' + document.getElementById('abottomp').href + ' vs ' + document.getElementById('abottomn').href); return ''; } } //else { //setTimeout(newlpcheck, 3000); //} } //else { //setTimeout(newlpcheck, 3000); //} window.scroll(eval(('' + rect.x)), newtop); } } } else if (thish.indexOf('#content') != -1) { //firstlfh=thish; window.scroll(0, 0); var rect=document.getElementById(thish.split('#')[1].split('#')[0]).getBoundingClientRect(); if (('' + rect.top) != '') { console.log('rect.y=' + rect.y); var newtopc=eval(('' + rect.y)); //y)); newtopc-=eval('30'); //document.getElementById('i1').value); console.log('newtopc=' + newtopc); if (document.getElementById('abottomp')) { if (document.getElementById('abottomn')) { if (('' + document.getElementById('abottomp').href).trim() != '' && ('' + document.getElementById('abottomp').href).length == ('' + document.getElementById('abottomn').href).length) { //document.getElementById('abottomp').href+='#upthetop'; console.log('OoPs ' + document.getElementById('abottomp').href + ' vs ' + document.getElementById('abottomn').href); return ''; } } //else { //setTimeout(newlpcheck, 3000); //} } //else { //setTimeout(newlpcheck, 3000); //} window.scroll(0, newtopc); } } } } } setInterval(lfh, 1000);