The examples at the bottom of this list may incorporate techniques not yet covered in class. There may be bugs in these examples; please notify me if you find one. Many demonstrate a specific technique but are not much to look at otherwise. Examples worthy of special note as particularly good examples are marked with an asterisk.
Contents
- Basic HTML
- Style Sheets
- Page Formatting (see also Tables and Frames below)
- Tables and Area Maps
- Frames
- PHP
- Dynamic HTML
- Document Object Model
- JavaScript
- JavaScript Objects
- JavaScript Loops and Arrays
- Forms
- Multimedia
- Maintaining State (Cookies, etc.)
- JQuery
- A skeletal HTML document
- A more fleshed-out HTML document
- Some additions to the example above
- Special characters in HTML documents (accented letters, etc.)
- Your course home page (should be named index.html and placed directly in the public_html directory of your course account.
- A web page with style and without
- The course home page with no style or alternate style [CSS files: original, alternate. Best viewed in Firefox.]
- Simple navbar image replacement
- * More sample navbar styles using a simple unordered list: Unstyled, Horizontal, Menu-style, Green Line, Minitabs, Finger, Clouds
- Style for links
- Examples of image alignment: old style and using css
- An outline using style sheets
- Use of style sheets to add a background image
- Style-sheet positioning
- Z-index control via CSS
- * Effect combining background images and z-index
- Drop caps using :first-letter pseudoclass
- Photo cropping via CSS
- Another way to crop: Clip rectangle control via CSS
- Using free online web fonts
- * Sample page example, from initial div structure (view source to see), div structure with base layout but no content, to final fixed layout. Also see the unstyled content and final boxes visualization
- * Flex layout version of example above (resize browser window to demonstrate)
- * Some basic flex grid examples: One, Two, Three
- Formatting using various methods: CSS positioning with <div> blocks, tables (old), frames (old)
- CSS position demo
- A CSS layout example, with two variant layouts: One, Two
- Two columns
- Another CSS positioning example, showing a seamless look.
- * Floating blocks of text and graphics
- Centering tables (and other elements, too)
- * Layout ideas: One, Two, Three. If you use Dreamweaver, it has a lot more sample layout options to choose from as you create a new file.
- A simple table
- A table with cells spanning multiple rows and columns
- A hidden table gives two-column text
- Use of an area map
- * A split image arranged in a table
- Style sheets for tables
- A basic set of frames
- The same set of frames, with some JavaScript improvements
- Frames/noframes example, with a navbar that appears only in noframes mode.
- * Seamless frames/noframes transitions.
- An example of an internal frame, with JavaScript improvements
- A Web "magazine", showing some uses of internal frames
- A remote control, using frames
- Dynamically changing style properties via the DOM: original page; dynamic behavior added.
- Very basic rollovers (see note above)
- Improved rollovers using a function (see note above)
- * Swapping multiple images on a rollover
- Using rollovers to influence behavior
- A rollover with preloading of images
- Rollover navigation bar
- Navigation bar with dynamic motion effects
- Other dynamic mouseover effects
- Image fade rollover effect, using CSS
- * A slide show, using the interval timer
- A slide show with controls
- A slide show with more complex controls
- A double slide show using the interval timer
- Two ways to make page elements appear and disappear
- Drop-down menus: one, two, three, *four.
- Basic popups
- Thumbnail popups: basic, intermediate, advanced
- How to annoy the user...
- An interactive story, using layers with dynamic visibility changes,
- A dynamic color picker
- * Dynamic content display (using visibility controls)
- A dynamic index (built from scratch)
- Dynamic HTML to produce flying text and image
- Flying text that changes, built upon the previous example
- * Dragging elements with the mouse
- Sparkling letters
- Keyboard control
- * A complete JavaScript application: tic-tac-toe
- * Another JavaScript application: Conway's angel
- Automatic last update notice.
- Using the document object to change colors
- Window size (and other useful properties)
- Putting window size to use.
- Some other uses of the window object
- A script that displays object properties
- General cross-browser DOM
- General cross-browser DOM in an external script file
- Sampler of changes via cross-browser DOM
- Some uses of the navigator object
- Using the window.open method to create a popup window
- Dynamic HTML to produce moving text
- Dynamic HTML to change the text of a link. Using buttons (easiest); Partial cross-browser version (no Netscape 4.x); Fully cross-browser version
- Basic JavaScript examples: #1, #2, #3.
- Some simple JavaScript commands
- Display the current time using Date() (older version here.)
- Use of the if...else construct
- A simple password scheme.
- A variant password scheme using an if.
- Use of the while loop construct to check for a password
- Use of the switch construct
- * More on variable content: if/else, multiple if/else, switch
- Calling an external JavaScript
- Logical operators in Javascript
- Review of some Javascript statement types
- Using functions to organize scripts and avoid unnecessary duplication
- * Example using functions of increasing flexibility: no arguments, one argument, two arguments.
- Functions that return values
- Another example of use of functions
- Example of events
- Timing events
- Example of variable scope
- Use of dialog boxes
- Using an external JavaScript file to include a header
- Examples of some objects
- Date object and arrays
- Functions and the Image object
- Using the Math object
- A table of sines, using a simple loop
- A checkerboard, using a pair of nested loops
- Motion animation using loops
- Using a loop to add elements to a page (advanced DOM)
- An introduction to arrays
- Using a loop to go through arrays in the document object model
- Associative arrays and using arrays to store history
- Pieces on the checkerboard can be kept track of using a 2D array
- A form, showing all the basic input types
- A form, demonstrating various form events
- Javascript and forms (external page from the University of Washington)
- Another form, whose results are interpreted using JavaScript, including an external script for form processing. (Note: .js files are best viewed in Firefox.)
- Using Smith's PHP remailer with method="post"
- JavaScript with menus and radio buttons
- A generic form processor: direct the results of any form to this address and you will see a table of the form results.
- Preventing accidental form submission
- Dynamic form checking (order form)
- * A quiz
- Dynamic content display: form and results
- * HTML5 Canvas examples: One, Two, Three, Four, Five
- Some canvas flags
- * Another canvas example, showing meters.
- Using canvas for a dynamic background.
- A visible timer bar
- * Sound effects, including audible roll on/off
- Page with background music. Use with caution!
- Simple media, with examples of different encodings
- Older multimedia examples (HTML 4 and prior)
- Quick test of basic cookie functionality in your browser
- A page that displays all currently active cookies in a table (for debugging)
- A cookie explorer that will let you set a cookie with any key/value pair. Uses an external JavaScript file cookie.js which you may want to copy. (Note: .js files are best viewed in Firefox.)
- Basic use of cookies: a page that stores information in a cookie, and another page that reads the information.
- Similar example (older): a page that stores preferences in a cookie, and another page that reads those preferences.
- * User preferences stored using cookies.
- A page that saves form values to cookies, a form to send it some information, and a page to display the cookie that was set.
- Cookies with set expirations
- Example of the use of hidden frames (a somewhat dated technique)
- Cookies to store data gathered over time
- A systematic approach to state maintenance: intro page, script file
- Using the variable-saving script package: start page
- Page formatting via JQuery.
- Form input widgets via JQuery.
Basic HTML
Style Sheets
Page Formatting & Layout
More HTML: Tables and Area Maps
Frames
Dynamic HTML
Note: the next seven items below use javascript to swap images and create a rollover effect. Although there are cases where this technique is required, more often a similar effect can be achieved more easily using the CSS :hover pseudoclass as seen in this example and these ones.