{"id":36146,"date":"2018-02-13T03:01:55","date_gmt":"2018-02-12T17:01:55","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=36146"},"modified":"2018-02-11T16:09:29","modified_gmt":"2018-02-11T06:09:29","slug":"place-quiz-hints-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/place-quiz-hints-tutorial\/","title":{"rendered":"Place Quiz Hints Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Place Quiz Hints Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.png\" title=\"Place Quiz Hints Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Place Quiz Hints Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Place Quiz Primer Tutorial' href='#pqppt'>Place Quiz Primer Tutorial<\/a> was another &#8220;where&#8221; themed web application.  We like doing these, being into the (x,y) of life.  If you want the (x,y,z) get a Golden Retriever &#8230; they&#8217;re always looking up.<\/p>\n<p>But, and it&#8217;s such a shame to start the sentence with &#8220;but&#8221;, but there you are.  What was I saying?  But we digress?  No buts about it?  Oh yeah, but what about that &#8220;fourth dimension&#8221; that &#8220;onion of the 4th dimension&#8221; &#8230; time &#8230; and our frequent &#8220;time conduit&#8221; &#8230; timezones.  You might recall that we have TimeZone information in that &#8230;<\/p>\n<p><code><br \/>\n<i>places<\/i> global var<font size=1>iable<\/font> array<br \/>\n<\/code><\/p>\n<p> &#8230; and so, you might want to think of this quiz as a &#8220;where and when&#8221; web application, and as a result, we&#8217;d like to call on other web applications from our domain to serve as hints for the user wanting to know more and\/or fishing for hints with the quiz.  We call on, housed in an <a target=_blank title='Overlay blog posts' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay'>overlaid<\/a> &#8230;<\/p>\n<ul>\n<li><a target=_blank title='CSS position:absolute information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_class_position.asp'>position:absolute<\/a> property<\/li>\n<li><a target=_blank title='CSS z-index information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_pos_z-index.asp'>z-index<\/a><\/li>\n<li><a target=_blank title='CSS opacity property information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/css3_pr_opacity.asp'>opacity<\/a><\/li>\n<\/ul>\n<p> &#8230; HTML iframe element positioned, but independent of, eventwise, our main HTML div element (running the quiz) &#8230;<\/p>\n<ul>\n<li><a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Charts<\/a> <a target=_blank title='Google Chart Map Chart' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4832'>Map Chart<\/a> (separate <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Map\/map.php\">live run<\/a>)<\/li>\n<li><a target=_blank title='Other Side of the World Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/other-side-of-the-world-primer-tutorial\/'>Other Side of the World Primer Tutorial<\/a>&#8216;s (separate <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/other_side_of_the_world.htm\">live run<\/a>) &#8230; and then, separate to rjmprogramming.com.au domain &#8230;<\/li>\n<li><a target=_blank title=http:\/\/www.timezoneconverter.com\/ href=HTTP:\/\/www.timezoneconverter.com\/>TimeZone Converter<\/a> website helps integrate the &#8220;when&#8221; with the &#8220;where&#8221; of above<\/li>\n<\/ul>\n<p>Again, please feel free to try out today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.htm\" title=\"Click picture\">Place Quiz<\/a> based on the HTML and Javascript (largely DOM) and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.html-GETME\" title=\"background_more.html-GETME\">background_more.htm<\/a> source code, which changed <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.html-GETME\" title=\"background_more.html-GETME\">this way<\/a> for your perusal and, perhaps, download.<\/p>\n<hr>\n<p id='pqppt'>Previous relevant <a target=_blank title='Place Quiz Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/place-quiz-primer-tutorial\/'>Place Quiz 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\/background_more.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Place Quiz Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.jpg\" title=\"Place Quiz Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Place Quiz Primer Tutorial<\/p><\/div>\n<p>As we inferred (with) the &#8220;Did you Know?&#8221; section of the recent <a title='Column Intelligence Primer Tutorial' href='#cipt'>Column Intelligence Primer Tutorial<\/a> (that it) was of &#8220;Chestnut Cracking&#8221; importance to us, representing the long held ambition to zero in on a method to have a background with transparency teamed up with that same HTML element&#8217;s &#8220;foreground&#8221; having full opacity (or more opacity than the background).  Thanks, again, <a target=_blank title='Great link' href='https:\/\/stackoverflow.com\/questions\/7241341\/can-i-set-an-opacity-only-to-the-background-image-of-a-div'>great webpage<\/a>!<\/p>\n<p>Today, we&#8217;re going to present an HTML and Javascript and CSS quiz web application based on the deployment of this method in a Javascript DOM dynamic version of its CSS essence, whereby &#8230;<\/p>\n<ul>\n<li>an HTML div element is made to cover the screen with a &#8230;<\/li>\n<li>horizontally centered HTML h1 &#8220;foreground&#8221; element nested within, containing a quiz question &#8230; over the top of &#8230; another <a target=_blank title='Overlay blog posts' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay'>overlay<\/a> scenario &#8230;<\/li>\n<li>all encompassing background image with some transparency and uses <i>background-repeat;repeat;<\/i> helping the user out with a hint for what the quiz answer would be, which the user can score points for by &#8230;<\/li>\n<li>clicking anywhere on the HTML div element gives the user the opportunity to answer the Place quiz question via a Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window within a time period determined by &#8230;<\/li>\n<li><code><a target=_blank title='Javascript setInterval method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_setinterval.asp'>setInterval<\/a>(changeit,5000); \/\/ controls the time period between question changes to 5 seconds as a default, but the clock stops during an HTML div element click operation<\/code><\/li>\n<\/ul>\n<p>As per a lot of our (quiz) games, here, there is a &#8230;<\/p>\n<ol>\n<li><i>score<\/i> global var<font size=1>iable<\/font> &#8230; and a &#8230;<\/li>\n<li><i>goes<\/i> global var<font size=1>iable<\/font> &#8230; and then, more specific to today&#8217;s (quiz) game, there are &#8230;<\/li>\n<li><i>viablequestions<\/i> global var<font size=1>iable<\/font> array<\/li>\n<li><i>viableanswers<\/i> global var<font size=1>iable<\/font> array<\/li>\n<li><i>viableimageurl<\/i> global var<font size=1>iable<\/font> array &#8230; the arrays populated (via [arrayVar].<a target=_blank title='Javascript push method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_push.asp'>push<\/a>([value]);) via an analysis of the &#8220;programmer controlled&#8221; &#8230;<\/li>\n<li><i>places<\/i> global var<font size=1>iable<\/font> array whose information comes from a combination of &#8230;\n<ul>\n<li><a target=_blank title='http:\/\/php.net\/manual\/en\/datetimezone.getlocation.php' href='http:\/\/php.net\/manual\/en\/datetimezone.getlocation.php'>TimeZone Place<\/a> information via &#8220;the home of <a target=_blank title='Home of PHP' href='http:\/\/php.net\/'>PHP<\/a>&#8220;, thanks<\/li>\n<li><a onclick=' aclick=true; ' id=awiki target=_blank title='Wikipedia' href='https:\/\/wikipedia.org'>Wikipedia<\/a> image URLs, thanks<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>Please feel free to try out today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.html\" title=\"Click picture\">Place Quiz<\/a> based on the HTML and Javascript (largely DOM) and CSS <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_more.html_GETME\" title=\"background_more.html_GETME\">background_more.html<\/a> source code for your perusal and, perhaps, download.<\/p>\n<hr>\n<p id='cipt'>Previous relevant <a target=_blank title='Column Intelligence Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/column-intelligence-primer-tutorial\/'>Column Intelligence 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\/background_attachment.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Interesting Places Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_attachment.jpg\" title=\"Column Intelligence Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Column Intelligence Primer Tutorial<\/p><\/div>\n<p>Newspapers work as a media source largely because of their column format.  It is no coincidence newspapers got this format, if you research <a target=_blank title='Typesetting information from Wikipedia, thanks' href='https:\/\/graphicdesign.stackexchange.com\/questions\/3553\/why-do-newspapers-use-multiple-columns'>typesetting<\/a>.<\/p>\n<p>In the online world, presentation formats have more possibilities and varieties than newspapers presented, but that doesn&#8217;t mean &#8220;newspaper column&#8221; or &#8220;newspaper column <i>with intelligence<\/i>&#8221; can&#8217;t be options for the design of online web pages.   Today, we tip our toes in the waters of this topic by creating an HTML and CSS and Javascript web application with &#8230;<\/p>\n<ul>\n<li>an HTML div element nesting &#8230;<\/li>\n<li>three HTML div elements placed to the left, in the middle, and to the right &#8230; our 3 (newspaper) columns &#8230; except that &#8230;<\/li>\n<\/ul>\n<p> &#8230; intelligence to scroll the (newspaper) column content made up of <\/p>\n<ol>\n<li>text &#8230; and &#8230;<\/li>\n<li>background image<\/li>\n<\/ol>\n<p> &#8230; is scrollable, relative to each other, in three different ways, namely &#8230;<\/p>\n<ul>\n<li>style=&#8221; <a target=_blank title='CSS background-attachment property information from w3schools' href='https:\/\/www.w3schools.com\/cssref\/pr_background-attachment.asp'>background-attachment<\/a>: fixed; &#8221; &#8230; text, only, moves as you scroll, and the (first of the) background imagery&#8217;s top\/left is the web page&#8217;s top\/left<\/li>\n<li>style=&#8221; background-attachment: local; &#8221; &#8230; both, above, move together as you scroll &#8230; new with CSS3<\/li>\n<li>style=&#8221; background-attachment: scroll; &#8221; &#8230; text, only, moves as you scroll, and the (first of the) background imagery&#8217;s top\/left is the styled element&#8217;s top\/left<\/li>\n<\/ul>\n<p>You can try this out with our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_attachment.html\" title=\"Click picture\">live run<\/a> link that has underlying HTML and CSS and Javascript <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/background_attachment.html_GETME\" title=\"background_attachment.html\">background_attachment.html<\/a>.<\/p>\n<p><b><i>Did You Know?<\/i><\/b><\/p>\n<p>We&#8217;re having a purple patch regarding &#8220;old chestnut&#8221; cracking!  Today&#8217;s is that wish to apply opacity <i>just<\/i> to background image, but not the corresponding textual data (or other types) that is the primary content of that HTML element.   How to do?  Well, we were lucky enough to stumble upon the wonderful <b>additional styling<\/b> advice from this <a target=_blank title='Great link' href='https:\/\/stackoverflow.com\/questions\/7241341\/can-i-set-an-opacity-only-to-the-background-image-of-a-div'>stupendous webpage<\/a>, thanks, regarding the CSS styling (example) &#8230;<\/p>\n<p><code><br \/>\n&lt;style&gt;<br \/>\n#left { \/\/ background-color: #661715;<br \/>\n       background-image: <b>linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),<\/b> url('http:\/\/www.rjmprogramming.com.au\/Welcome_files\/shapeimage_1a.png');<br \/>\n       background-repeat: repeat;<br \/>\n       background-position: top left;<br \/>\n       background-attachment: fixed; }<\/p>\n<p>#middle { \/\/ background-color: #661715;<br \/>\n       background-image: <b>linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),<\/b> url('http:\/\/www.rjmprogramming.com.au\/Welcome_files\/shapeimage_1a.png');<br \/>\n       background-repeat: repeat;<br \/>\n       background-position: top left;<br \/>\n       background-attachment: local; }<\/p>\n<p>#right { \/\/ background-color: #661715;<br \/>\n       background-image: <b>linear-gradient(rgba(255,255,255,0.4),rgba(255,255,255,0.4)),<\/b> url('http:\/\/www.rjmprogramming.com.au\/Welcome_files\/shapeimage_1a.png');<br \/>\n       background-repeat: repeat;<br \/>\n       background-position: top left;<br \/>\n       background-attachment: scroll; }<br \/>\np { opacity: 1.0; }<br \/>\nh3 { opacity: 1.0; }<br \/>\n&lt;\/style&gt;<br \/>\n<\/code><\/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='#d35811' onclick='var dv=document.getElementById(\"d35811\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/scrolling\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35811' 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='#d36123' onclick='var dv=document.getElementById(\"d36123\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/opacity\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36123' 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='#d36146' onclick='var dv=document.getElementById(\"d36146\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/iframe\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36146' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s Place Quiz Primer Tutorial was another &#8220;where&#8221; themed web application. We like doing these, being into the (x,y) of life. If you want the (x,y,z) get a Golden Retriever &#8230; they&#8217;re always looking up. But, and it&#8217;s such a &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/place-quiz-hints-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":[126,127,281,342,354,476,477,481,518,576,587,652,2126,876,894,2134,949,997,1022,1125,1693,1319],"class_list":["post-36146","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-background","tag-background-image","tag-css","tag-div","tag-dom","tag-game","tag-games-2","tag-geographicals","tag-google-chart","tag-html","tag-iframe","tag-javascript","tag-map-chart","tag-opacity","tag-overlay","tag-place","tag-placenames","tag-programming","tag-quiz","tag-setinterval","tag-timezone","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36146"}],"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=36146"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36146\/revisions"}],"predecessor-version":[{"id":36153,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36146\/revisions\/36153"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=36146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=36146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=36146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}