{"id":16544,"date":"2015-08-12T05:01:11","date_gmt":"2015-08-11T19:01:11","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=16544"},"modified":"2015-08-11T20:08:06","modified_gmt":"2015-08-11T10:08:06","slug":"slideshow-animation-via-image-visibility-modelling-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/slideshow-animation-via-image-visibility-modelling-tutorial\/","title":{"rendered":"Slideshow Animation via Image Visibility Modelling Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Slideshow Animation via Image Visibility Modelling Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.png\" title=\"Slideshow Animation via Image Visibility Modelling Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Slideshow Animation via Image Visibility Modelling Tutorial<\/p><\/div>\n<p>Yesterday, with <a target=_blank title='Slideshow Animation via Image Visibility Follow Up Tutorial' href='#savivfut'>Slideshow Animation via Image Visibility Follow Up Tutorial<\/a> as shown below, we continued our pictorial, and where possible, textual, synopsis of blog postings &#8230; an encapsulation, should we say, presented in the form of a slideshow, where we introduced an HTML <a target=_blank title='HTML meter element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_form.asp'>form<\/a> element into the mix, which facilitates navigation to other blog postings, where those blog posting are examined via the PHP $_GET[] parameters posted to itself, scrutinising the relevant blog posting for its image-related data.<\/p>\n<p>Today&#8217;s coding of this current project brought issues of &#8220;genericity&#8221; to the fore.  As programmers we often strive for genericity with our work.  After all, once you put in all the hours on a piece of software, it can be a bit of a letdown if it applies to too small a set of circumstances or user usage.  On the flipside, though, to obsess about genericity can be a good aim, but should stop at a certain point, because, no matter how well you do with it, it can be argued by someone, somewhere, that it doesn&#8217;t measure up.  Think of the &#8220;language&#8221; requirements for instance.  Think of, &#8220;will it work with no electricity&#8221; for instance.  So obsessing overly, is a waste of angst, but if you don&#8217;t care either, it makes for a lazy approach to programming, which will not be noticed with the narrow scope of your endeavours.<\/p>\n<p>&#8220;Genericity&#8221; obviously helps explain code to the next person, who perhaps won&#8217;t have to do a thing, but you can also &#8220;model&#8221; a solution and make it pretty obvious what modelling assumptions you&#8217;ve made.  Our big issue with &#8220;genericity&#8221; in our current endeavour is how to pin down how image-related data could be represented in a &#8220;genericist&#8217;s head&#8221; in &#8230;<\/p>\n<ol>\n<li><strike>any web page<\/strike> &#8230; too ambitious &#8230; so &#8230;<\/li>\n<li><strike>any blog page<\/strike> &#8230; too many blog &#8220;brands&#8221; &#8230; so &#8230;<\/li>\n<li><strike>any WordPress blog posting<\/strike> &#8230; getting closer, but too many WordPress themes &#8230; so &#8230;<\/li>\n<li><stroke>any<\/strike> WordPress Twenty Ten theme blog posting &#8230; let&#8217;s say &#8230; and we&#8217;ll do the &#8220;modelling&#8221; for what happens here at this blog to point following programmers into the right direction to make modifications<\/li>\n<\/ol>\n<p> &#8230; as a personal observation find the most useful &#8220;leads&#8221; to a &#8220;modelling&#8221; scenario, are global variables up the top of the code (and it doesn&#8217;t have to be too many, even &#8230; just something &#8220;to hang your hat on&#8221;), and comments at the top of the code &#8230; nothing more &#8230; you should be able to &#8220;remodel&#8221; with just these cues, we figure.  Take a look at <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php--GETME\" title='slideshow_via_invisibility_and_fade.php'>slideshow_via_invisibility_and_fade.php<\/a> and hope you understand enough to rework it for your own purposes.<\/p>\n<p>Okay, today we tackled that thorny issue to do with image-related data &#8220;extraction&#8221; from the contents of a WordPress TwentyTen theme blog posting (here at this blog &#8230; but reworkable for others, we feel sure)  We identified four scenarios &#8230;<\/p>\n<ol>\n<li>&lt;a &#8230;&gt;&lt;\/a&gt; tag href to an internal slideshow HTML file<\/li>\n<li>Twirling Javascript onmouseover scenario &#8230; use <a target=_blank title='PHP eval() method information' href='http:\/\/php.net\/manual\/en\/function.eval.php'>eval<\/a>([PHPequivalentOfJavascript]) to derive next image name (until, and excluding when, we get back to first image name)<\/li>\n<li>Single image scenario &#8230; and &#8230;<\/li>\n<li>Image place specified that has &lt;td&gt; &#8230; &lt;\/td&gt; encasing &lt;ing &#8230; \/&gt; and any relevant displayable text (comment) wording<\/li>\n<\/ol>\n<p>You can see our progression for yourself with the PHP source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php--GETME\" title='slideshow_via_invisibility_and_fade.php'>slideshow_via_invisibility_and_fade.php<\/a> which changed from yesterday as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php--GETME\" title='slideshow_via_invisibility_and_fade.php'>this link<\/a>, or try a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php\" title=\"Click picture\">live run<\/a>.<\/p>\n<hr>\n<p id='savivfut'>Previous relevant <a target=_blank title='Slideshow Animation via Image Visibility Follow Up Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/slideshow-animation-via-image-visibility-follow-up-tutorial\/'>Slideshow Animation via Image Visibility Follow Up Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Slideshow Animation via Image Visibility Follow Up Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.gif\" title=\"Slideshow Animation via Image Visibility Follow Up Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Slideshow Animation via Image Visibility Follow Up Tutorial<\/p><\/div>\n<p>We continue on with yesterday&#8217;s tutorial <a target=_blank title=\"Slideshow Animation via Image Visibility Primer Tutorial\" href=\"#savivpt\">Slideshow Animation via Image Visibility Primer Tutorial<\/a> which extended the &#8220;overlay&#8221; idea presented previously with <a target=_blank title='WordPress Blog Search Within Search Overlay Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-search-within-search-overlay-tutorial\/'>WordPress Blog Search Within Search Overlay Tutorial<\/a> where, you might remember, we had three HTML elements, one visible and the rest invisible, and we &#8220;overlayed&#8221; (in quotes, because the technique does not need the CSS <a target=_blank title='CSS position property information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_class_position.asp'>&#8220;position:absolute&#8221;<\/a> property to work) by changing which one was visible at any given time (and at any given time, only one is visible).<\/p>\n<p>Yesterday&#8217;s work had a hard coded feel to it, and today we widen the scope out a bit more to be generic enough to handle other blog postings, here at this blog, with a pictorial, and where possible, textual, synopsis of the blog posting &#8230; an encapsulation, should we say, presented in the form of a slideshow.  We cater for this genericity by introducing an HTML <a target=_blank title='HTML meter element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_form.asp'>form<\/a> element into the mix, which facilitates navigation to other blog postings, where those blog posting are examined via the PHP $_GET[] parameters posted to itself, scrutinising the relevant blog posting for its image-related data.  For each blog posting, this can take on a different &#8220;guise&#8221; and so this is the greatest challenge with this project.<\/p>\n<p>As well, regarding yesterday&#8217;s work &#8230; the HTML <a target=_blank title='HTML meter element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'>meter<\/a> element is not supported with Internet Explorer, nor mobile platforms, so let&#8217;s substitute in an HTML input type=number element instead.<\/p>\n<p>Another matter of interest is the way we have the wording to accompany the images sit within an HTML <a target=_blank title='HTML div element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'>div<\/a> element within a table cell (HTML <a target=_blank title='HTML td element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_td.asp'>td<\/a> element) so that it justifies to the bottom of the table cell, achieved via the <b>bold<\/b> CSS bits &#8230;<\/p>\n<p><code><br \/>\n&lt;td id='twording' style=' background-color: #f0f0f0; <b>display: table-cell; vertical-align: bottom;<\/b>'&gt;<br \/>\n<\/code><\/p>\n<p>We wanted to thank <a target=_blank title='Useful link' href='http:\/\/stackoverflow.com\/questions\/585945\/how-to-align-content-of-a-div-to-the-bottom-with-css'>this link<\/a> heaps, for advice, here.<\/p>\n<p>There&#8217;s more to do, but isn&#8217;t there just about always. You can see our progression for yourself with the PHP source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php-GETME\" title='slideshow_via_invisibility_and_fade.php'>slideshow_via_invisibility_and_fade.php<\/a> which changed from yesterday as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php-GETME\" title='slideshow_via_invisibility_and_fade.php'>this link<\/a>, or try a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php\" title=\"Click picture\">live run<\/a> &#8230; believe me, it is better than a dead run.<\/p>\n<hr>\n<p id='savivpt'>Previous relevant <a target=_blank title=\"Slideshow Animation via Image Visibility Primer Tutorial\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/slideshow-animation-via-image-visibility-primer-tutorial\/\">Slideshow Animation via Image Visibility 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\/PHP\/slideshow_via_invisibility_and_fade.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Slideshow Animation via Image Visibility Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.jpg\" title=\"Slideshow Animation via Image Visibility Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Slideshow Animation via Image Visibility Primer Tutorial<\/p><\/div>\n<p>Today&#8217;s tutorial extends the &#8220;overlay&#8221; idea presented yesterday with <a target=_blank title='WordPress Blog Search Within Search Overlay Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-blog-search-within-search-overlay-tutorial\/'>WordPress Blog Search Within Search Overlay Tutorial<\/a> where, you might remember, we had three HTML elements, one visible and the rest invisible, and we &#8220;overlayed&#8221; (in quotes, because the technique does not need the CSS <a target=_blank title='CSS position property information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_class_position.asp'>&#8220;position:absolute&#8221;<\/a> property to work) by changing which one was visible at any given time (and at any given time, only one is visible).<\/p>\n<p>Today&#8217;s tutorial takes the image data from <a target=_blank title='Developing Black and White Photos Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/developing-black-and-white-photos-primer-tutorial\/'>Developing Black and White Photos Primer Tutorial<\/a> as a good candidate to use with PHP&#8217;s <a target=_blank title='PHP glob() method information' href='http:\/\/php.net\/manual\/en\/function.glob.php'>glob()<\/a> method we discussed last when we presented <a target=_blank title='PHP Modularization for Lighthouses in Australia Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-modularization-for-lighthouses-in-australia-tutorial\/'>PHP Modularization for Lighthouses in Australia Tutorial<\/a>.<\/p>\n<p>The images of this tutorial are &#8220;relatively&#8221; stacked into a table cell and take their turns at being the visible one to create the slideshow animation feel to our resultant <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php\" title='Slideshow live run'>presentation<\/a>.<\/p>\n<p>Some other concepts we&#8217;ve visited today with PHP source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/slideshow_via_invisibility_and_fade.php_GETME\" title='slideshow_via_invisibility_and_fade.php'>slideshow_via_invisibility_and_fade.php<\/a> are &#8230;<\/p>\n<ul>\n<li>homemade Javascript image fading via controlling the image (HTML img tag) CSS <a target=_blank title='CSS opacity property information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/css3_pr_opacity.asp'>opacity<\/a> property via an independent <a target=_blank title='Javascript setTimeout method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_settimeout.asp'>setTimeout<\/a> controlled Javascript function<\/li>\n<li>using the HTML <a target=_blank title='HTML meter element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_meter.asp'>meter<\/a> element&#8217;s <a target=_blank title='Javascript onclick event information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/event_onclick.asp'>onclick<\/a> event to turn it into more than a display, but rather a user means to adapt the presentation &#8230; believe me, there are many other ways to achieve this, and this is just an idea for you to mull over &#8230; maybe you remember that last time we talked about the HTML meter element at <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-staged-animation-meter-presentation-tutorial\/' title='HTML\/Javascript Staged Animation Meter Presentation Tutorial'>HTML\/Javascript Staged Animation Meter Presentation Tutorial<\/a><\/li>\n<li>CSS rotation (of an HTML <a target=_blank title='HTML div element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp'>div<\/a> element) which we talked about previously with <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/css3-rotation-and-transformation-primer-tutorial\/' title='CSS3 3D Rotation and Transformation Primer Tutorial'>CSS3 3D Rotation and Transformation Primer Tutorial<\/a> &#8230; why? &#8230; well, the HTML meter we wanted to control the &#8220;position:absolute; top:70px;&#8221; of (ie. leave the &#8220;left&#8221; property relative), so that we could calibrate the user&#8217;s click from a known top Y co-ordinate, along with the known length of the HTML meter element (which we specify)<\/li>\n<li>the wording to go with the images garnered from the web via PHP&#8217;s <a target=_blank title='PHP file_get_contents() method information' href='http:\/\/php.net\/manual\/en\/function.file-get-contents.php'>file_get_contents()<\/a> method<\/li>\n<\/ul>\n<p>Hope this topic is of interest to you, or of practical benefit for something you are trying &#8230; it is a topic where cross-browser and cross-platform thoughts could be very important as to how you proceed.<\/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='#d16512' onclick='var dv=document.getElementById(\"d16512\"); 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='d16512' 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='#d16512' onclick='var dv=document.getElementById(\"d16512\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=form\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d16512' 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='#d16544' onclick='var dv=document.getElementById(\"d16544\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=global-string\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d16544' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday, with Slideshow Animation via Image Visibility Follow Up Tutorial as shown below, we continued our pictorial, and where possible, textual, synopsis of blog postings &#8230; an encapsulation, should we say, presented in the form of a slideshow, where we &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/slideshow-animation-via-image-visibility-modelling-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,33,37],"tags":[84,281,282,399,1662,429,452,1615,1664,590,652,1663,861,876,894,932,980,997,1072,1151,1166,1319],"class_list":["post-16544","post","type-post","status-publish","format-standard","hentry","category-animation","category-elearning","category-event-driven-programming","category-software","category-tutorials","tag-animation-2","tag-css","tag-css3","tag-eval","tag-fade","tag-file_get_contents","tag-form","tag-glob","tag-global","tag-image","tag-javascript","tag-model","tag-onclick","tag-opacity","tag-overlay","tag-php","tag-presentation","tag-programming","tag-rotation","tag-slideshow","tag-software-2","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/16544"}],"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=16544"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/16544\/revisions"}],"predecessor-version":[{"id":16550,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/16544\/revisions\/16550"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=16544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=16544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=16544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}