{"id":53931,"date":"2021-11-14T03:01:53","date_gmt":"2021-11-13T17:01:53","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=53931"},"modified":"2021-11-14T06:54:59","modified_gmt":"2021-11-13T20:54:59","slug":"hashtag-navigation-scrolling-tweaks-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/hashtag-navigation-scrolling-tweaks-primer-tutorial\/","title":{"rendered":"Hashtag Navigation Scrolling Tweaks Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/hashtag_and_a_bit.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Hashtag Navigation Scrolling Tweaks Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/hashtag_and_a_bit_poc.jpg\" title=\"Hashtag Navigation Scrolling Tweaks Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Hashtag Navigation Scrolling Tweaks Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve got what we hope is an interesting proof of concept web application for you today.  What do you think of &#8230;<\/p>\n<blockquote><p>\nHagtag navigation plus a Scrolling correction\n<\/p><\/blockquote>\n<p> &#8230; combining that &#8230;<\/p>\n<ul>\n<li>HTML #hashtag navigation eg. #t5  &#8230; combined with &#8230;<\/li>\n<li>Javascript location.hash detection of this plus any &#8220;double hashtagging&#8221; eg. #t5#andabit=-40  &#8230; combined with &#8230;<\/li>\n<li>Javascript document.getElementById(&#8216;t5&#8217;).getBoundingClientRect().y usage within (external Javascript <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/hashtag_and_a_bit.js_GETME\" title=\"hashtag_and_a_bit.js\">hashtag_and_a_bit.js<\/a>) &#8230;<br \/>\n<code><br \/>\n\/\/ hashtag_and_a_bit.js<br \/>\n\/\/ RJM Programming<br \/>\n\/\/ November, 2021<br \/>\n\/\/ Help out Hashtag Position Less a Bit<br \/>\n<br \/>\n  var firstlfh='';<br \/>\n  var dgbiv='-40';<br \/>\n<br \/> <br \/>\n  function lfh() {<br \/>\n    if (1 == 1) {<br \/>\n    var thish=('' + location.hash);<br \/>\n    if (thish != firstlfh) {<br \/>\n      firstlfh=thish;<br \/>\n      if (firstlfh.split('#').length &gt; 2) {<br \/>\n        if (firstlfh.split('#andabit').length == 2) {<br \/>\n          window.scroll(0, 0);<br \/>\n          var rect=document.getElementById(firstlfh.split('#')[1].split('#')[0]).getBoundingClientRect();<br \/>\n          if (('' + rect.top) != '') {<br \/>\n            var newtop=eval(('' + rect.y));<br \/>\n            newtop+=eval('' + dgbiv); \/\/document.getElementById('i1').value);<br \/>\n            window.scroll(0, newtop);<br \/>\n          }<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n    }<br \/>\n  }<br \/>\n<br \/>\n  setInterval(lfh, 1000);<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; to cover for those occasions where hashtag navigation misses the &#8220;true&#8221; mark you intended, as it is apt to do, in our experience?  And in our experience a &#8220;small scrolling correction&#8221; can hit the &#8220;true&#8221; mark, it&#8217;s just that with today&#8217;s proof of concept <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/hashtag_and_a_bit.html_GETME\" title=\"hashtag_and_a_bit.html\">hashtag_and_a_bit.html<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/hashtag_and_a_bit.html\" title=\"Click picture\">web application<\/a> it can be programmed for rather that being a second step occasionally requiring user intervention &#8230;<\/p>\n<div class=\"container demo animated\"><iframe style='width:100%;height:400px;' src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/hashtag_and_a_bit.html\"><\/iframe><\/div>\n<p> &#8230; for those users who hate &#8220;tweak scrolling&#8221;, we guess!<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d53931' onclick='var dv=document.getElementById(\"d53931\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/hashtag\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d53931' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve got what we hope is an interesting proof of concept web application for you today. What do you think of &#8230; Hagtag navigation plus a Scrolling correction &#8230; combining that &#8230; HTML #hashtag navigation eg. #t5 &#8230; combined with &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/hashtag-navigation-scrolling-tweaks-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[3854,2229,557,576,652,2169,830,997,1986,1917,1107,1319,3744],"class_list":["post-53931","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-double-hashtag","tag-hash","tag-hashtag","tag-html","tag-javascript","tag-location-hash","tag-navigation","tag-programming","tag-proof-of-concept","tag-scroll","tag-scrolling","tag-tutorial","tag-tweak"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53931"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=53931"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53931\/revisions"}],"predecessor-version":[{"id":53937,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/53931\/revisions\/53937"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=53931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=53931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=53931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}