Yesterdayโs Sprite Background Menu Navigation Primer Tutorial set the scenario for todayโs work, that we are often looking for. You see, weโre trying to help beginners to web application creation here, by and large, and there is no better topic to learn about than โฆ anyone, anyone? Yes, Brendan, the working knowledge of Javascript, as the prominent anyone, anyone? Semi-pending-yes, semi-snaps for you if you mean theme and not theme if you know what I mememean (chortle, chortle)!
Yes, beginners to this โweb application caperโ should learn โฆ
- HTML (design) โฆ to show something โฆ perhaps the first thing to learn โฆ and โฆ
- Javascript (programming) โฆ to have interactions of interest in that webpage above โฆ the major โclientsideโ thing to learn โฆ otherwise can be a bit boring โฆ though there is also โฆ
- CSS (styling) โฆ to control the look of the creation โฆ the โshow your friendsโ โclientsideโ thing to learn โฆ though we have done โno Javascriptโ tutorials in the past
โฆ but we would say that middle one is your topic to concentrate on throughout your learning.
Add to that, down the track, by adding to those โclientsideโ scenarios above, a โserversideโ programming skill, such as PHP programming (for our Apache/PHP/MySql favourite local web browser via MAMP, scenarios).
And so with yesterdayโs Sprite Background Menu Navigation Primer Tutorial all of us got you to a โno Javascriptโ start on the CSS Sprites memetheme. Today we stage some Javascript โeasing in to learningโ memethemes โฆ
Javascript idea โฆ | HTML/Javascript coding change |
---|---|
Navigations (if, like hereโ, embedded within an HTML iframe element *) |
|
Navigations |
* โฆ
<script type='text/javascript'>
function inIframe() { // thanks to https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
</script>
Previous relevant Sprite Background Menu Navigation Primer Tutorial is shown below.
There are a lot of ways to design and code for a menu used for navigation in a webpage. We happened to be reading CSS Sprites, and where it said โฆ
CSS sprites technique is a way to reduce the number of HTTP requests made for image resources, by combining images in a single file.
โฆ and its great menu navigation example (which forms a huge part of our sprite_eghtmlโs live
run link), we wanted to use it to adapt it with inhouse content. That content is the Sprite image we constructed with a combination of โฆ
- some inhouse images via a Google image search, thanks
- in macOS command-control-shift-3 to Paintbrush File->New from Clipboard to huhagain.png (internal use only)
- in macOS Paintbrush File->New 50 pixels x 500 pixels saved to newSprite.png โฆ though at this early stage imagine it all white โฆ
For 5 image choices | ||||
---|---|---|---|---|
oneinfive.png | twoinfive.png | threeinfive.png | fourinfive.png | fiveinfive.png |
Rectangular select from huhagain.png relevant bit File->New from Clipboard Image->Image Sizeโฆ 50 pixels x 50pixels File->Save Asโฆ oneinfive.jpg Edit->Select All Edit->Copy #Reopen Paintbrush huhagain.png In terminal (with ImageMagick installed) โฆ Open Paintbrush onefive.jpg #Reopen Paintbrush huhagain.png |
As far left substitute โoneโ for โtwoโ |
As far left substitute โoneโ for โthreeโ |
As far left substitute โoneโ for โfourโ |
As far left substitute โoneโ for โfiveโ |

โฆ to end up with the originals and negated โonhover flip sidedโ colour negations (or inversion) Sprite image backgrounds to the menu imagery. We hope it interests!
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.