{"id":66200,"date":"2025-02-02T03:01:00","date_gmt":"2025-02-01T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=66200"},"modified":"2025-02-01T20:53:46","modified_gmt":"2025-02-01T10:53:46","slug":"wordpress-blog-byline-zoom-fix-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-byline-zoom-fix-tutorial\/","title":{"rendered":"WordPress Blog Byline Zoom Fix Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/byline.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"WordPress Blog Byline Zoom Fix Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/byline.gif\" title=\"WordPress Blog Byline Zoom Fix Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">WordPress Blog Byline Zoom Fix Tutorial<\/p><\/div>\n<p>That&#8217;s it!  We&#8217;re doing something today regarding &#8230;<\/p>\n<blockquote><p>\nHow on non-mobile, with this blog, the byline &#8230;<br \/>\n  A &#8220;Dot Dot Dot&#8221; Information Technology Blog<br \/>\n &#8230; can mal-align as a user zooms in or out.\n<\/p><\/blockquote>\n<p>And we were doing things for the first time we can remember, regarding the fix, which we weren&#8217;t expecting.   So &#8230;<\/p>\n<p>For the first time we can remember &#8230;<\/p>\n<ul>\n<li>for a <i>position: absolute<\/i> &#8220;overlay&#8221; scenerio &#8230; we did not use a <i>left: 123<strong>px<\/strong><\/i> style of positioning &#8230; but, rather &#8230;<\/li>\n<li>used a <i>right: 45.6<strong>%<\/strong><\/i> style of positioning &#8230;<\/li>\n<li>lining the byline&#8217;s <i>right<\/i> with the blog title&#8217;s <i>right<\/i> &#8230; more or less &#8230;<\/li>\n<li>making the byline more central &#8230;<\/li>\n<li>giving it more &#8220;wander room&#8221; as a user zooms in or out<\/li>\n<\/ul>\n<p>Ever since the advent of &#8220;mobile&#8221; platforms, the idea of &#8220;zoom&#8221; has become more and more of a &#8220;mute point&#8221;, but not for &#8220;non-mobile&#8221;, as with this &#8220;kind of unusual&#8221; adding, via &#8220;overlay&#8221; idea, regarding HTML elements.<\/p>\n<p>On this topic, we&#8217;d like to thank <a target=\"_blank\" title='Excellent advice' href='https:\/\/stackoverflow.com\/questions\/995914\/catch-browsers-zoom-event-in-javascript' rel=\"noopener\">this excellent link<\/a> which reminded us that &#8220;responsive design&#8221;&#8216;s biggest friend is the percent (ie. &#8220;%&#8221;) unit of webpage measure!<\/p>\n<p>By the way, even on &#8220;non-mobile&#8221;, the window.onresize event is triggered we found, but once there we struggled to do much about the mal-alignment zooming in or out was sometimes doing to the byline off to the left.<\/p>\n<p>The new code <font color=blue>(intervention, that made the difference)<\/font>, in good ol&#8217; header.php?<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\nfunction bylinedo() {<br \/>\n  var ahuhrect=document.getElementById('access').getBoundingClientRect();<br \/>\n  var huhrect=document.getElementById('ahomeis').getBoundingClientRect();<br \/>\n  if (navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile\/i)) {<br \/>\n  document.getElementById('ahomeis').innerHTML=document.getElementById('ahomeis').innerHTML.replace(' Blog', ' &lt;span id=sbyline&gt;&lt;font size=2&gt;&lt;i&gt;&lt;strong&gt;... I.T.&lt;\/strong&gt;&lt;\/i&gt;&lt;\/font&gt;&lt;\/span&gt; Blog');<br \/>\n  } else {<br \/>\n  \/\/document.getElementById('hdgspan').innerHTML+='&lt;span id=sbyline style=\"position:absolute;left:' + ahuhrect.left + 'px;top:' + eval(53 + eval('' + huhrect.top)) + 'px;\"&gt;&lt;font size=2&gt;&lt;i&gt;&lt;strong&gt;A \"Dot Dot Dot\" Information Technology Blog&lt;\/strong&gt;&lt;\/i&gt;&lt;\/font&gt;&lt;\/span&gt;';<br \/>\n  \/\/alert('sw=' + screen.width + ' al=' + ahuhrect.left + ' ... ' + eval(100 * eval('' + screen.width) \/ eval('' + ahuhrect.left)));<br \/>\n  \/\/ Thanks to https:\/\/stackoverflow.com\/questions\/995914\/catch-browsers-zoom-event-in-javascript<br \/>\n  document.getElementById('hdgspan').innerHTML+='&lt;span id=sbyline style=\"position:absolute;<font color=blue>right:' + eval(100 * eval('' + huhrect.right) \/ eval('' + screen.width)) + '%;<\/font>top:' + eval(53 + eval('' + huhrect.top)) + 'px;\"&gt;&lt;font size=2&gt;&lt;i&gt;&lt;strong&gt;A \"Dot Dot Dot\" Information Technology Blog&lt;\/strong&gt;&lt;\/i&gt;&lt;\/font&gt;&lt;\/span&gt;';<br \/>\n  \/\/window.onresize=function(){ alert(65); var bhuhrect=document.getElementById('access').getBoundingClientRect(); document.getElementById('hdgspan').style.left='' + bhuhrect.left + 'px';  };<br \/>\n  }<br \/>\n}<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/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='#d66200' onclick='var dv=document.getElementById(\"d66200\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d66200' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>That&#8217;s it! We&#8217;re doing something today regarding &#8230; How on non-mobile, with this blog, the byline &#8230; A &#8220;Dot Dot Dot&#8221; Information Technology Blog &#8230; can mal-align as a user zooms in or out. And we were doing things for &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-byline-zoom-fix-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,37],"tags":[151,4099,5035,281,2761,652,1643,3965,894,2255,932,4260,1991,3347,1325,3873,1899,1891,1456,3276,1498],"class_list":["post-66200","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-blog","tag-byline","tag-centering","tag-css","tag-header-php","tag-javascript","tag-justification","tag-justify","tag-overlay","tag-percentage","tag-php","tag-positioning","tag-responsive-design","tag-right","tag-twentyten-theme","tag-unit","tag-units","tag-user","tag-wordpress","tag-wordpress-blog","tag-zoom"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66200"}],"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=66200"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66200\/revisions"}],"predecessor-version":[{"id":66204,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66200\/revisions\/66204"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=66200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=66200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=66200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}