JavaScript Assignment #18

Control Window Locations

This assignment gets deeper with windows concepts explored in assignment #14, in particular looking at how to position windows on the screen.

  1. Create a basic page in html that includes a single image.
  2. When the image is clicked, it should open 5 new windows in the following locations on the screen:
    • one in the top left corner of the screen
    • one in the top right corner
    • one in the lower left corner
    • one in the lower right corner
    • one in the center of the screen

    The URLs displayed for each window can be of your choosing.

  3. When the main window is closed, all of the sub windows should also automatically close.
  4. Bonus challenge: using randomization, have a sixth window open in a random location on the page. It should appear in a different location each time the button is pressed.

Note: you will likely have to give your browser permission to open new windows.

Next assignment ... Assignment #19