Today, we created a DOBRIC (Dynamic On Browser Refresh Image Changer) in class. Using four found images, this script randomly adds one of the four images to the HTML document every time the user refreshes the page.
Mission: Write a script that determines your user’s musical preference out of three options of your choosing, and based on that preference, display different page content.
This code makes a box that moves left and right across the browser window 500 pixels. BOOM.
This code creates 3 divs (called “box”). When the user clicks on any box in the browser, the script automatically changes that box’s height and width to a random height and width, and changes its background color to a random background color. Simple fun.
Using cookies, this page allows the user to type their username into a form, submit the form, refresh the page and be greeted with their username.
Here is some sample HTML text content (all about meat). Using jQuery, the user can highlight and un-highlight each paragraph by clicking on the text. When the user mouses over any header, the text size of the header will increase until it reaches 50. Also, every time the user mouses over any header, random pictures of kittens appear at random places within the browser window.
Arrays and Loops.
Using arrays and loops, create a table that lists the brands of five shoe companies next to the (fictional) worth of each company. Store the information (shoe company names and associated value) using arrays. Using either type of loop, add the HTML elements for a table (<table>, <tr>, <th>, <td>, etc.) to the document. The easiest way to store the data is in two separate arrays, where each numerical index of one array associates to the other. You could also use a multi-dimensional array or object.