{"id":23394,"date":"2016-07-21T03:01:07","date_gmt":"2016-07-20T17:01:07","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=23394"},"modified":"2016-07-21T23:07:20","modified_gmt":"2016-07-21T13:07:20","slug":"htmljavascriptcss-reveal-top-left-to-bottom-right-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascriptcss-reveal-top-left-to-bottom-right-tutorial\/","title":{"rendered":"HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/lrtb_surprise.jpg\" title=\"HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript\/CSS Reveal Top Left to Bottom Right Tutorial<\/p><\/div>\n<p>We need to revisit the <a target=_blank title='Reveal tutorials here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal'>&#8220;Reveal&#8221;<\/a> series of blog postings, and elaborate a bit.  The reason is that something we were doing yesterday with presenting the top left &#8220;subset&#8221; picture (of the main tutorial picture at the top) you can see at <a target=_blank title='Trip Mobile Device Usage Clock Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/trip-mobile-device-usage-clock-tutorial\/#subsetdiv'>Trip Mobile Device Usage Clock Tutorial<\/a> reminded us of the powerful HTML <a target=_blank title='HTML div element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'>div<\/a> element CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property&#8217;s usefulness.  Hence the reference to a &#8220;Reveal&#8221; tutorial of relevance below called <a title='HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial' href='#hjcrttbpt'>HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/a> as shown below, which is built upon, with its top to bottom revealing talents, to present, today, a reveal from top to bottom and left to right.  You will find with writing this code that all of the previous tutorial&#8217;s &#8230;<\/p>\n<ul>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property<\/li>\n<li>Encasing working visible HTML elements within <a target=_blank title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> element for ease of:\n<ol>\n<li>positioning<\/li>\n<li>scrolling, or not<\/li>\n<li>visibility control<\/li>\n<\/ol>\n<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_setinterval.asp' title='setInterval'>setInterval<\/a> and <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_clearinterval.asp' title='clearInterval'>clearInterval<\/a> timer functionality<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/js\/js_htmldom.asp' title='Javascript DOM'>DOM<\/a> methods to dynamically change HTML (over time)<\/li>\n<li>HTML\/CSS body element <a target=_blank title='Background information at w3schools ... thanks' href='http:\/\/www.w3schools.com\/css\/css_background.asp'>background<\/a> URL (with fallback background colour) and the Javascript control of its <a target=_blank title='Body backgroundImage URL nullified advice from w3schools ... thanks' href='http:\/\/www.w3schools.com\/jsref\/prop_style_backgroundimage.asp'>fallback<\/a> to just the background colour and that it is Clickable<\/li>\n<\/ul>\n<p> &#8230; remain relevant, and some additional ideas as below &#8230;<\/p>\n<ul>\n<li>There were a lot of those old &#8220;sinful&#8221; <i>align=&#8217;center&#8217;<\/i> usage we talked about at <a target=_blank title='W3C XHTML Nu Checker Validation Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/w3c-xhtml-nu-checker-validation-primer-tutorial\/'>W3C XHTML Nu Checker Validation Primer Tutorial<\/a> going on which we diligently changed to <i>style=&#8221; width:100%;text-align:center; &#8220;<\/i> for most HTML elements, in order to preserve horizontal centering, which meant that &#8230;<\/li>\n<li>Window.<a target=_blank title='Information about Window.getComputedStyle' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/getComputedStyle'>getComputedStyle<\/a> Javascript functionality that is needed to combine with &#8230;<\/li>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_margin-left.asp\">margin-left<\/a> style property<\/li>\n<li>Events <a target=_blank title='Javascript event onload information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ev_onload.asp'>onload<\/a> helps us out initially and <a target=_blank title='Javascript event onresize information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ev_onresize.asp'>onresize<\/a> helps us out should the window size change to contribute to the document.body width calculation required to derive a good margin-left value to use<\/li>\n<\/ul>\n<p> &#8230; are needed to make the whole thing work.<\/p>\n<p>We hope this is food for thought for you, and we&#8217;ll leave you with &#8230;<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html' title='Click picture'>Live Run<\/a><\/li>\n<li>HTML programming source code you could call <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html-GETME' title='reveal_lefttoright_toptobottom.html'>reveal_lefttoright_toptobottom.html<\/a><\/li>\n<li>How we got there from the top to bottom logic of tutorial below can be seen <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_lefttoright_toptobottom.html-GETME' title='reveal_lefttoright_toptobottom.html'>here<\/a><\/li>\n<\/ul>\n<hr>\n<p id='hjcrttbpt'>Previous relevant <a target=_blank title='HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascriptcss-reveal-top-to-bottom-primer-tutorial\/'>HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/surprise.jpg\" title=\"HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript\/CSS Reveal Top to Bottom Primer Tutorial<\/p><\/div>\n<p>Welcome to a new discussion regarding HTML, Javascript and CSS on the theme of &#8220;reveal&#8221;.  We&#8217;ll be doing several postings on this theme, and today we have the first.<\/p>\n<p>Do you often wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise?   <\/p>\n<p align='center'>No?<\/p>\n<p>Do you sometimes wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise?  <\/p>\n<p align='center'>Still no, huh?  (<i>Aside:<\/i> two can play this <font size=1>little<\/font> game)<\/p>\n<p>Do you occasionally wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise &#8230; OR &#8230; <br \/>will allow those who have <i>never<\/i> had this thought in their life on Earth?  <\/p>\n<p align='center'>No again, huh?  (<i>Aside:<\/i> two planets can play this puerile <font size=1>little<\/font> game!)<\/p>\n<p>Do you ever wish to make webpages that hide things until the user interacts with the webpage or some time period has expired, so that there is some sort of element of surprise &#8230; OR &#8230; <br \/>will allow those who have <i>never<\/i> had this thought in their life on Earth, nor Mars?  <\/p>\n<p align='center'>Non? Nicht?  Good nicht! (chortle, chortle)<\/p>\n<p align='center'>Well, that&#8217;s fixed their <font size=1>little<\/font> <span style='color:red;'>red<\/span> wagon.<\/p>\n<p>Here is a tutorial that &#8220;reveals&#8221; a surprise from top to bottom using HTML, Javascript and CSS, featuring:<\/p>\n<ul>\n<li>CSS <a target=_blank title=\"CSS overflow:hidden idea information from w3schools ... thanks\" href=\"http:\/\/www.w3schools.com\/cssref\/pr_pos_overflow.asp\">overflow: hidden;<\/a> style property<\/li>\n<li>Encasing working visible HTML elements within <a target=_blank title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'><i>div<\/i><\/a> element for ease of:\n<ol>\n<li>positioning<\/li>\n<li>scrolling, or not<\/li>\n<li>visibility control<\/li>\n<\/ol>\n<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_setinterval.asp' title='setInterval'>setInterval<\/a> and <a target=_blank href='http:\/\/www.w3schools.com\/jsref\/met_win_clearinterval.asp' title='clearInterval'>clearInterval<\/a> timer functionality<\/li>\n<li>Javascript <a target=_blank href='http:\/\/www.w3schools.com\/js\/js_htmldom.asp' title='Javascript DOM'>DOM<\/a> methods to dynamically change HTML (over time)<\/li>\n<li>HTML\/CSS body element <a target=_blank title='Background information at w3schools ... thanks' href='http:\/\/www.w3schools.com\/css\/css_background.asp'>background<\/a> URL (with fallback background colour) and the Javascript control of its <a target=_blank title='Body backgroundImage URL nullified advice from w3schools ... thanks' href='http:\/\/www.w3schools.com\/jsref\/prop_style_backgroundimage.asp'>fallback<\/a> to just the background colour and that it is Clickable<\/li>\n<\/ul>\n<p>So here is today&#8217;s tutorial&#8217;s <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html' title='Click picture'>live run<\/a>, and here is the HTML programming source code you could call <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Reveal\/reveal_fromtoptobottom.html_GETME' title='reveal_fromtoptobottom.html'>reveal_fromtoptobottom.html<\/a> which called on the content of this <a href='#' onclick=' var huh=prompt(\"Hit OK to open new webpage showing this tutorial.  Am asking because you may not want to reveal this yet (it would give away the secret to the surprise, perhaps?), and if not hit Cancel or wipe out URL and hit OK.\", \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=9389\");  if (huh.indexOf(\"http\") != -1) { window.open(huh,\"_blank\"); } '>tutorial<\/a>.<\/p>\n<p>Chow for now, <font size=1>brown cow (she&#8217;s always on(line), you know &#8230; <b><i>but is anything sinking in?!<\/i><\/b> &#8230; I haven&#8217;t been able to moo respectfully in public after 63.5 lessons?! &#8230; she still owes me that half lesson when she didn&#8217;t get up in time for milking)<\/font>.<\/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='#d9389' onclick='var dv=document.getElementById(\"d9389\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=DOM\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d9389' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d23394' onclick='var dv=document.getElementById(\"d23394\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/reveal\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d23394' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We need to revisit the &#8220;Reveal&#8221; series of blog postings, and elaborate a bit. The reason is that something we were doing yesterday with presenting the top left &#8220;subset&#8221; picture (of the main tutorial picture at the top) you can &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascriptcss-reveal-top-left-to-bottom-right-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":[4,12,14,16,30,37],"tags":[281,354,400,1801,491,576,652,894,997,1063,1125,1319],"class_list":["post-23394","post","type-post","status-publish","format-standard","hentry","category-animation","category-elearning","category-event-driven-programming","category-gimp","category-photography","category-tutorials","tag-css","tag-dom","tag-event","tag-getcomputedstyle","tag-gimp","tag-html","tag-javascript","tag-overlay","tag-programming","tag-reveal","tag-setinterval","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/23394"}],"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=23394"}],"version-history":[{"count":9,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/23394\/revisions"}],"predecessor-version":[{"id":23444,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/23394\/revisions\/23444"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=23394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=23394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=23394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}