My newest clients site went live today, www.patcomstock.com! Pat is solo performer, acoustic guitarist and songwriter located in Upstate NY. His new site was designed to give him more expsoure and make him feel like a rock star. It’s 97% done and just needs a few more tweaks before its 100%. I wish Pat the best in everything he does…Check it out and leave some comment love
We will be working with custom and positioning functions and we will need the following to create the animations for our web page:
Function that returns an object’s left coordinate
Function that returns an object’s top coordinate
Function to place an object at specific coordinates on the page
Function to move an object a certain distance from its current location
Function to hide an object
Function to unhide an object
Each object in JavaScript has properties associated with it. The number of properties depends on the type of object: some objects have only a few properties, while others have many. The syntax for setting the vale of an object property is:
object.property = expression
where object is the JavaScript name of the object you want to manipulate, property is a property of that object, and expression is a JavaScript expression that assigns a value to the property. Not all properties can be changed. Some properties are read-only, meaning that you can read the property value, but you cannot modify it.
Dynamic HTML or DHTML involves the interaction of three aspects of Web design:
A page’s HTML/XHTML code
A style sheet that defines the styles used in the page
A script, usually written in either JavaScript or VBScript, to control the behavior of elements on the page
DHTML is not a seperate language. Instead, it can be thought of as a collection of programming techniques that use the scripting language to modify a Web page’s contents or styles after the page is initially rendered by the browser.
A break command can be used anywhere within our program code. The purpose of the break command is to terminate any program loop or condtional statement. When a browser runs a break command, it passes control to the statement immediately following it. The break statement is most often used to exit a program loop without waiting for the loop to end when the stopping conditon is met.
A conditional statement is a statement that runs a command or command block only when certain conditions are met. The most common conditional statement is the If statement. The syntax of the If statement is:
if (condition) {
commands
}
where condition is a Boolean expression that is either true or false, and commands is the command block that is run if condition is true. If only one command is run, you can dispense with the command block and just enter the if statement. The condition expression uses the same comparison and logical operators you’ve used in previous tutorials. The main difference between a comparison operator and a conditional statement is that, instead of changing the value of a variable based on a condition, you are choosing whether or not to run a particular command or command block. If statements can be nested inside of one another to test for two conditions.
A program loop is a set of commands that is executed repeatedly until a stopping condition has been met. Two commonly used program loops in JavaScript are the For and While loops.
In a For loop, a variable known as a counter variable is used to track the number of times a set of commands is run. Each time through the loop, the value of the counter variable is increased or decreased by a set amount. When the counter variable reaches a specified value, the For loop stops.
An array is a collection of data values organized under a single name. Each individual data value has a number, or index that distinguishes it from other values in the array. The general form of an array value is:
array[i]
where array is the name of the array and i is the index of a specific value in the array. It is important to remember that the index values that with 0 and not 1 and count up from there.
We have been working on our countdown clock throughout this tutorial series and only one problem remains: our clock only changes when the page is reloaded. In this final part of the tutorial, we will make our clock dynamic so that it reloads on its own, to do this we will use time-delayed and timed-interval commands.
When using mathematical operations in JavaScript there will be situations where we need to work with the properties of numeric values. JavaScript provides several methods to examine the properties of numbers and how they are displayed on the web. Some mathematical operations will return results that are not numeric values. For example: if you tried to divide a number by a text string, you would get a value of “NaN” or not a number. We can test for this error using the isNaN() function. Another example: if you tried to divide by zero you would get an error which results in the value infinity. We can test for this error using the isFinite() function.

