Google offers some scripts that can be embedded in your code for your purposes.
Note that the scripts look like client-side JavaScripts, but they engage the Google servers and thus are actually server-side scripts.
UNIX/LINUX ⇒ | command | argument | value |
HTML ⇒ | tag | attribute | value |
CSS ⇒ | selector | declaration property | declaration value |
JavaScript ⇒ | script | variable | value |
For instance, there is a date last updated Javascript in the footer of every single page on the class website. View the source code and you will find it. It is between lines 282 and 317 on this page, but it is in the footer of every page.
You have a need to ensure the viewer knows the last time your page was updated, so this script can serve your purposes.
But there are many others.
Look at this MouseOver Image example, noting the code and the script components and the linking of the alternating image to a relative location.
<!DOCTYPE html>
<html lang="en">
<head>
<script>
function newImg(e){
e.src = "assets/images/study-close.png"
}
function oldImg(e){
e.src = "assets/images/study-far.png"
}
</script>
</head>
<body bgcolor="gray">
<h2>MouseOver and MouseOff an Image</h2>
<p>
This page illustrates using the <em>mouseOver</em> on an image.
As you drag the mouse over the image, notice how the image changes.
</p>
<div>
<img src="assets/images/study-far.png" width="50%" onmouseover="newImg(this)" onmouseout="oldImg(this)">
</div>
<p>The second replaces the initial one.</p>
</body>
</html>
Try to modify this code for your own use. You may use any pair of images, but you must store them in the same subdirectory where you store your page code [so the script can find them in order to display them]. Here are two you can download for use.
These two images are the same size, but you may need to take a look at other images in an image editing software program to determine the size of the image. You will need to use these in order to change the size attributes for the images in the script.
This page illustrates using the mouseOver on an image. As you drag the mouse over the image, notice how the image changes.
The second replaces the initial one.
Copyright © R.E. Bergquist 2014- | Last Updated on | Powered by w3.css