Making of Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial
As far as CSS styling goes with our web application work, personally speaking, it is one of โฆ
Give it a bit of oompha!
โฆ moments in coding we think we learn more from, than reading about CSS. That, and, usually StackOverflow, thanks, where examples of achieving some styling ambition teach us a lot too.
Yesterday, with Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial, we decided to โput a bit of oomphaโ into that โtwo bell emojiโ ( ie. ) link โdouble buzzerโ sound โproduction numberโ, and wanted to break down what we ended up with, for readers โฆ
Our first try โฆ okay for non-mobile โฆ not as good for mobile โฆ
if (top.document.URL.indexOf('/esp_ornot_esp.') != -1 || parent.document.URL.indexOf('/esp_ornot_esp.') != -1) {
if (top.document.title.indexOf(' justaudio ') != -1) {
asuffis='&justaudio=&';
bsuffis=' name=justaudio ';
}
}
}
Letโs start with โฆ
Why canโt we just link to a YouTubevideo URL webpage off any old platform or web browser incarnation?
Well, you could! But we wanted a less obvious approach (and we were not sure about mobile platforms, trying this), only relevant for scenarios where you are only interested in the audio stream of a YouTube video (it should be noted), that is hiding from the reader โthe mechanicsโ of what we are doing (to get a cheap giggle โฆ there, are you happy now?!).
What does Javascript if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { } if test achieve?
If this test returns true we have detected a non-mobile platform/web browser scenario.
What does the HTML target attribute of an a HTML element do?
That target attribute determines the โnavigational placeโ of the href attribute URL of that a link where โฆ
_blank opens in a new window
_self clobbers current window
_top adds a new (tabbed) window (perhaps from the viewpoint of a child HTML iframe window)
other named target point to the name attribute of an HTML iframe element, presumably, in the current window
What does HTML code snippet onload=โif (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (this.src.indexOf(โAbout_Us.โ) != -1) { document.getElementById(โajaโ).target=โmyjaโ;
this.src=document.getElementById(โajaโ).href + โ&rand=โ + Math.floor(Math.random() * 1989786); } } โ do as the onload event logic of the โsecond versionโ iframe incarnation?
it is arranged from the child iframe inhouse YouTube video interfacing player web application using โoverlayโ concepts โฆ
position: absolute
opacity
z-index
top and left positioning
width and height dimensioning
into some button content
โฆ that what they are tapping is a YouTube video element
looking like at levels of a smaller z-index seen through opacity:0.0 higher z-index levels, the topmost transparent but high z-index one being the YouTube video element which is that webpage areaโs โaction itemโ โฆ if you will
Huh?!
On mobile platforms, media cannot play, these days, unless it is as a direct result of a user tap (excluding programmatically produced taps). See all this in action, with thanks to FreeConvert, below โฆ
And so, yes โฆ was it worth it? Perhaps not to do with the job at hand, but for future reference, weโre happy to give this added oompha to this effort.
If this was interesting you may be interested in this too.