CSC 105

Examples of Specific Techniques

 

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

  1. Basic HTML
  2. Style Sheets
  3. Page Formatting (see also Tables and Frames below)
  4. Tables and Area Maps
  5. Frames
  6. PHP
  7. Dynamic HTML
  8. Document Object Model
  9. JavaScript
  10. JavaScript Objects
  11. JavaScript Loops and Arrays
  12. Forms
  13. Multimedia
  14. Maintaining State (Cookies, etc.)
  15. JQuery

    Basic HTML

  1. A skeletal HTML document
  2. A more fleshed-out HTML document
  3. Some additions to the example above
  4. Special characters in HTML documents (accented letters, etc.)
  5. Your course home page (should be named index.html and placed directly in the public_html directory of your course account.
  6. Style Sheets

  7. A web page with style and without
  8. The course home page with no style or alternate style [CSS files: original, alternate. Best viewed in Firefox.]
  9. Simple navbar image replacement
  10. * More sample navbar styles using a simple unordered list: Unstyled, Horizontal, Menu-style, Green Line, Minitabs, Finger, Clouds
  11. Style for links
  12. Examples of image alignment: old style and using css
  13. An outline using style sheets
  14. Use of style sheets to add a background image
  15. Style-sheet positioning
  16. Z-index control via CSS
  17. * Effect combining background images and z-index
  18. Drop caps using :first-letter pseudoclass
  19. Photo cropping via CSS
  20. Another way to crop: Clip rectangle control via CSS
  21. Using free online web fonts
  22. Page Formatting & Layout

  23. * 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
  24. * Flex layout version of example above (resize browser window to demonstrate)
  25. * Some basic flex grid examples: One, Two, Three
  26. Formatting using various methods: CSS positioning with <div> blocks, tables (old), frames (old)
  27. CSS position demo
  28. A CSS layout example, with two variant layouts: One, Two
  29. Two columns
  30. Another CSS positioning example, showing a seamless look.
  31. * Floating blocks of text and graphics
  32. Centering tables (and other elements, too)
  33. * 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.
  34. More HTML: Tables and Area Maps

  35. A simple table
  36. A table with cells spanning multiple rows and columns
  37. A hidden table gives two-column text
  38. Use of an area map
  39. * A split image arranged in a table
  40. Style sheets for tables
  41. Frames

  42. A basic set of frames
  43. The same set of frames, with some JavaScript improvements
  44. Frames/noframes example, with a navbar that appears only in noframes mode.
  45. * Seamless frames/noframes transitions.
  46. An example of an internal frame, with JavaScript improvements
  47. A Web "magazine", showing some uses of internal frames
  48. A remote control, using frames
  49. Dynamic HTML

  50. Dynamically changing style properties via the DOM: original page; dynamic behavior added.
  51. 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.

  52. Very basic rollovers (see note above)
  53. Improved rollovers using a function (see note above)
  54. * Swapping multiple images on a rollover
  55. Using rollovers to influence behavior
  56. A rollover with preloading of images
  57. Rollover navigation bar
  58. Navigation bar with dynamic motion effects
  59. Other dynamic mouseover effects
  60. Image fade rollover effect, using CSS
  61. * A slide show, using the interval timer
  62. A slide show with controls
  63. A slide show with more complex controls
  64. A double slide show using the interval timer
  65. Two ways to make page elements appear and disappear
  66. Drop-down menus: one, two, three, *four.
  67. Basic popups
  68. Thumbnail popups: basic, intermediate, advanced
  69. How to annoy the user...
  70. An interactive story, using layers with dynamic visibility changes,
  71. A dynamic color picker
  72. * Dynamic content display (using visibility controls)
  73. A dynamic index (built from scratch)
  74. Dynamic HTML to produce flying text and image
  75. Flying text that changes, built upon the previous example
  76. * Dragging elements with the mouse
  77. Sparkling letters
  78. Keyboard control
  79. * A complete JavaScript application: tic-tac-toe
  80. * Another JavaScript application: Conway's angel
  81. Document Object Model

  82. Automatic last update notice.
  83. Using the document object to change colors
  84. Window size (and other useful properties)
  85. Putting window size to use.
  86. Some other uses of the window object
  87. A script that displays object properties
  88. General cross-browser DOM
  89. General cross-browser DOM in an external script file
  90. Sampler of changes via cross-browser DOM
  91. Some uses of the navigator object
  92. Using the window.open method to create a popup window
  93. Dynamic HTML to produce moving text
  94. Dynamic HTML to change the text of a link. Using buttons (easiest); Partial cross-browser version (no Netscape 4.x); Fully cross-browser version
  95. JavaScript

  96. Basic JavaScript examples: #1, #2, #3.
  97. Some simple JavaScript commands
  98. Display the current time using Date() (older version here.)
  99. Use of the if...else construct
  100. A simple password scheme.
  101. A variant password scheme using an if.
  102. Use of the while loop construct to check for a password
  103. Use of the switch construct
  104. * More on variable content: if/else, multiple if/else, switch
  105. Calling an external JavaScript
  106. Logical operators in Javascript
  107. Review of some Javascript statement types
  108. Using functions to organize scripts and avoid unnecessary duplication
  109. * Example using functions of increasing flexibility: no arguments, one argument, two arguments.
  110. Functions that return values
  111. Another example of use of functions
  112. Example of events
  113. Timing events
  114. Example of variable scope
  115. Use of dialog boxes
  116. Using an external JavaScript file to include a header
  117. JavaScript Objects

  118. Examples of some objects
  119. Date object and arrays
  120. Functions and the Image object
  121. Using the Math object
  122. JavaScript Loops and Arrays

  123. A table of sines, using a simple loop
  124. A checkerboard, using a pair of nested loops
  125. Motion animation using loops
  126. Using a loop to add elements to a page (advanced DOM)
  127. An introduction to arrays
  128. Using a loop to go through arrays in the document object model
  129. Associative arrays and using arrays to store history
  130. Pieces on the checkerboard can be kept track of using a 2D array
  131. Forms

  132. A form, showing all the basic input types
  133. A form, demonstrating various form events
  134. Javascript and forms (external page from the University of Washington)
  135. Another form, whose results are interpreted using JavaScript, including an external script for form processing. (Note: .js files are best viewed in Firefox.)
  136. Using Smith's PHP remailer with method="post"
  137. JavaScript with menus and radio buttons
  138. A generic form processor: direct the results of any form to this address and you will see a table of the form results.
  139. Preventing accidental form submission
  140. Dynamic form checking (order form)
  141. * A quiz
  142. Dynamic content display: form and results
  143. Multimedia: Sound, Video, and Graphics

  144. * HTML5 Canvas examples: One, Two, Three, Four, Five
  145. Some canvas flags
  146. * Another canvas example, showing meters.
  147. Using canvas for a dynamic background.
  148. A visible timer bar
  149. * Sound effects, including audible roll on/off
  150. Page with background music. Use with caution!
  151. Simple media, with examples of different encodings
  152. Older multimedia examples (HTML 4 and prior)
  153. Maintaining State (Cookies, etc.)

  154. Quick test of basic cookie functionality in your browser
  155. A page that displays all currently active cookies in a table (for debugging)
  156. 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.)
  157. Basic use of cookies: a page that stores information in a cookie, and another page that reads the information.
  158. Similar example (older): a page that stores preferences in a cookie, and another page that reads those preferences.
  159. * User preferences stored using cookies.
  160. 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.
  161. Cookies with set expirations
  162. Example of the use of hidden frames (a somewhat dated technique)
  163. Cookies to store data gathered over time
  164. A systematic approach to state maintenance: intro page, script file
  165. Using the variable-saving script package: start page
  166. JQuery

  167. Page formatting via JQuery.
  168. Form input widgets via JQuery.