






























































 |
 Here are some useful things I have learnt about HTML and building
WebPages, which you might find useful:
Keep You Background Image Fixed in Place
<body background="images/image.jpg"
bgproperties="fixed">
Just ensure that bgproperties="fixed" comes
after background="images/image.jpg". This will
cause the text etc to scroll, however the background will stay where it is.
Last Modified Date
Just put this code on you page for it to display the date the page was last saved:
<SCRIPT LANGUAGE="JavaScript">
function initArray() {
this.length = initArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i]
}
var DOWArray = new
initArray("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");
var MOYArray = new
initArray("January","February","March","April",
"May","June","July","August","September",
"October","November","December");
var LastModDate = new Date(document.lastModified);
document.write("This page was last updated on ");
document.write(DOWArray[(LastModDate.getDay()+1)],", ");
document.write(MOYArray[(LastModDate.getMonth()+1)]," ");
document.write(LastModDate.getDate(),", ",(LastModDate.getYear()));
document.write(".");
</SCRIPT>
And here is what it does:
This code does not however seem to work in some browsers (like Netscape 3)
Opening a new window using JavaScript
This is useful if you want to display bigger versions of pictures, as you can put a
button underneath each picture and when it is clicked the larger version appears in a new
window. To do this just put the following code in your page:
<form method="POST" action>
<p><input type="button" value="Open New Window" name="View"
onClick="open('new_window.html','New_Win','toolbar=no,location=0,directories=0,status=0,
menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=200,height=200')"></p>
</form>
This code will produce the following:
|
































































|