This instructions page contain the following:
This is the fifth part of a multi-part project related to the fictional Oregon Film Festival site.
The second page you create for the Oregon Film Festival site will be the What's New page. It will be based on the Home page, but contain new content and a revised structure.
Part of the new content is a picture gallery made up of disjointed image rollovers. When the mouse moves over the smaller, thumbnail images, the image in the main area changes to a large version of the thumbnail. This is a type of rollover behavior referred to as a disjointed rollover since the rollover is not occurring to the smaller image the mouse moves over, but rather to another image on the same page in a different location. This is commonly done on picture gallery type Web pages.
We'll be using Javascript Behaviors to perform the disjointed rollovers. Below is a finished sample of how the Web page should look like when completed.
For the Oregon Film Festival site, we'll start by creating the second Web page.You have an index page (created in OYO 4), and you'll use that as the basis of your What's New page.
Here's the wireframe of the Oregon Film Festival What's New page (news-off.html) you'll create:
Note the following changes or additions to the structure of this page compared to index.html:
So, in total, you'll have 9 divs for your structure on this page. In these instructions, they'll be referred to by the name you see above or by their shortcut name: div#centerwrap, div#header, div#social, div#navcontainer, div#onecol, div#thbrow, div#thbcol, div#mainimage, and div#footer.
Instructor Note:
You can copy and paste the new file by right-clicking on it in the Files panel, then using Edit->Copy, etc., however, it's faster to use the Duplicate option. It's even faster to use the keystroke combination for Duplicate, which is Ctrl+D (PC). Duplicate does an immediate copy and paste into the same folder. Just click on the file in the Files panel, then press Ctrl+D.
Now that you see what you're goal is (in the wireframe above), you'll be able to update the structure following the steps below. It's not always the case that you'll have to update the structure of a page on your site when you copy the original page you made. In this case, it makes sense, because news-off.html only has one column instead of two in the middle section.
Instructor Note:
It should be emphasized at this point that you are radically altering the structure of this page to make it one column instead of two in that middle section. This will basically give you two different layout structures on your site. The index page has a two column structure, and the news-off page has a one column structure. This is not uncommon in Web design. In fact, on most sites, you'll find that the columns from page to page may vary in number or size, so it may require you to create more than one wireframe while planning your website. Then again, it's not complicated to make a simple adjustment like this one on a page-by-page basis if you need to.
You'll first edit the content that carried over from the index.html page to this page. You need make it appropriate for this new page. Also, you can do much of this in Design view, or just stay in Code view if you prefer.
Instructor Note:
As stated in OYO 4, it's much better to have a null link than linking the page you are on back to itself. If a user clicks on the link, and it's linking back to itself, it may reload the page in the browser window. This reloading (which, as you've seen, can cause a visual "flash" on the page) is likely to cause the user to think they've gone to a different page. It's just confusing. So instead, use the # (a null link) so the page doesn't do anything when the link is clicked on.
Also, you might be thinking, "well, why don't I remove the link entirely?". If you remove the link -- the a tag -- then its associated style goes away. In other words, that menu item won't look styled like the other navbar "buttons" on the site. So, again, it's one more reason to use the null link.
That's all the updated content. Now you'll add the new text content:
Next, you'll add the image content. But first, take a look in the Files panel at the images you're about to add, so you do it correctly. Your files panel should look very much like this one:
If you haven't looked in the news sub-folder yet under the assets folder, do so now. (This news sub-folder was in the Zip file you used to extract your assets in OYO 3. If you don't see the news folder inside the assets folder, be sure to get a copy of it from the oregonff Course Files.)
Note that inside the news sub-folder there are 19 images. 9 of the images are thumbnails (175x131) of the 9 larger images (600x450). In planning ahead, they have all been sized the same so they won't look awkward when the rollover occurs. Finally, there is 1 image file that is a blank image (600x450). This blank image is placed in div#mainimage and is used as the image the larger images are swapped out (rolled over) from. This will be explained in more detail in Part 5 below.
Based on the image dimensions stated above, you can make a few calculations to determine if or how the images will fit into their divs:
Instructor Note:
If you hadn't noticed this, text content inside a div will increase its height, regardless of what height you give the div in the CSS. The more text you put in a div, the taller it gets. Text content doesn't make a div wider though, so when you set a width (like on a div being used as a column), it won't be forced wider by the amount of text content in the div.
Image content is different. Images can increase a div's height AND width. In other words, one image that is wider than the div you put it inside, will force that div to match its width. This is why, with images, you should size them to fit your divs, otherwise, your divs will conform to the image's height and width and possibly throw off the layout of your page. Always, always, always size the images to fit inside your divs, and remember to take into account any padding inside the divs when you size your images. That being said, if you have multiple images, and the div width that they are in is the size of the largest of those images, then they may nicely stack on top of one another.
The CAS 208, Photoshop, class gets into more about how to work with images and re-size them.
Instructor Note:
There is no other way in Web design to effectively vertically center a div like this -- this is an often complained about serious flaw in Web design: no vertical centering. To make a div appear to center vertically, you'll have to use some combination of padding or margin on the top and/or bottom or top position with absolute or fixed position divs. To make it perfect without guessing, you'll have to do the math.
We can put these calculations away for the moment until we are ready to do the CSS styling in Part 4 (below).
In Code view, add the images to news-off.html as follows:
Instructor Note:
It's safer to insert images into the div in Code view at this point since you can't easily see the divs you just added in Design view.
When you are finished inserting the image content, your Web page should look very similar to this in Design view:
Instructor Note:
Be careful that there are no spaces between the images -- note above that they should be tight together. In preparing this the first time, I noticed I'd inadvertently left single blank spaces between the images. This will cause
your measurements in Part 4 (below) to be thrown off. It's easier to remove any extra blank spaces in Code view rather than Design view.
Here's what the code in div#onecol looks like:
It may appear a bit messy, but it doesn't contain spaces between the images, so it is correct as it is.
For this part, you'll use the CSS Styles Panel (All Button) to add to your existing oregonff.css style sheet for this page.
Create the selectors as follows (they should stay in the order they are listed here):
Instructor Note:
Setting "padding: 37px 50px;" is the same as setting Top/Bottom padding to 37px each and Right/Left padding to 50px each.
After styling this page, it should look very similar to this in a browser (Chrome in this case):
An image rollover is an image effect. To do rollovers or other image effects, you often must utilize JavaScript. JavaScript, which is a scripting language and very much like a programming language, is described in more detail in later classes. For now, you'll just use the JavaScript features built into Dreamweaver. Dreamweaver creates this script for you so you don't have to know how to write programming language code to do it yourself.
Instructor Note:
Some issues to keep in mind with JavaScript:
JavaScript is a scripting language owned by the Oracle Corporation. Although Oracle allows people to use the JavaScript code you create with their language without royalties (in other words, they don't charge you to use, copy or share JavaScript), they will attempt to collect royalties from you if you sell JavaScript code. Adobe, concerned about the fact that Oracle can change their royalty policy at any time, decided to try to minimize the legal issues. So in Dreamweaver, they avoid using the name "JavaScript" by calling their usage of that language "Behaviors". But, Behaviors in Dreamweaver are JavaScript scripts.
Keep in mind that browsers can be set to NOT run JavaScript functions. This is because JavaScript has been know to be a language that viruses are created in, so some people just choose to turn off this function in their browser. If your browser, or someone's browser who's looking at your page has JavaScript turned off, then you or they will not be able to see the rollover (or any other JavaScript effect) occur.
When testing your rollovers, you must do this in a browser. By default, Internet Explorer does throw up a warning flag to you if you attempt to test a Web page with JavaScript on it locally -- you'll have to Enable the scripting when you test JavaScript on your own computer. Oddly, IE doesn't seem to have a problem -- no warning by default -- if you go to any random page on the Internet that contains JavaScript...
A standard rollover occurs when you move the mouse pointer over one image and it turns into another.
A disjointed rollover occurs when you move the mouse pointer over one image and another image somewhere else on the page changes. Note this example of a disjointed rollover with bears. Notice that as you move your mouse over the smaller images (thumbnails), a larger image of the thumbnail appears below it. To accomplish this effect, you must "swap" or rollover one image to another. This means that the larger image of the bears that appears is being swapped with a blank image of the same size. You can't see it -- it's blank (no color or you can make it the same color as the background color of the page).
For this final part, you'll use the built-in Behaviors (JavaScript) in Dreamweaver to create disjointed (disconnected) rollovers. The effect you are going for is that when the mouse hovers over each of the thumbnail images, the blank image in div#mainimage rolls over to show the larger image that corresponds to the thumbnail image.
Instructor Note:
ID's should be unique to each image and should not duplicate any other ID's on the page, including ID's used with the divs. Good (and meaningful) ID's for the images across the top row would be, in order from left to right, "camera_test", "director", "boom", "asst_director", "behind_scenes". Again, remember not to duplicate any of the div ID's and they should be lower case with no spaces and no odd characters -- underscores are fine, but avoid hyphens for ID names.
Of course, if you don't know what these are images of, it's more difficult to make up meaningful ID's for them. In that case, "pic_01", "pic_02", "pic_03", etc. will work just fine, too.
Instructor Note:
By leaving "Preload Images" checked you are ensuring that there is no delay when you move the mouse over the original image and it switches to the other image. In other words, if you don't preload images (uncheck this option), then the rollover image would have to load into the browser/computer's memory at the time you move the mouse over it. This would cause a delay on the rollover and it might be confusing to the user. When images are preloaded, they are loaded into the browser/computer's memory at the time the entire page loads (exactly the way all other images on the Web page load into the browser), thereby causing no loading delay when you mouse over the rollover image.
As for unchecking "Restore image onMouseOut", this is on by default, which means that once you move your mouse pointer away from the rollover image, it would immediately revert back to the original image. Normally, with only one rollover image, this might make sense. We have a whole gallery and each of the thumbnails swap to the larger image. Since the next swapping image already replaces the previous image, then there's no need to revert back to the blank original. Not only that, but it's somewhat jarring to have it flip back to the blank image as your mouse pointer moves in-between one thumbnail and the next. It would give you a very awkward strobing effect that would also be off-putting to the user.
Instructor Note:
As you should be in the habit of doing, be sure to use a browser (or more than one browser) to check your Web pages on the SWS to ensure everything works properly.