HTML/JS

Items 11 to 20 of 66 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction
  1. New Perspectives on HTML and CSS Edition 6 Tutorial 5 Case Problem 2 The Chamberlain Civic Center.jpg

    New Perspectives on HTML and CSS Edition 6 Tutorial 5 Case Problem 2

    Regular Price: $12.00

    Special Price: $10.00

    New Perspectives on HTML and CSS Edition 6 Tutorial 5 Case Problem 2

    Data Files needed for this Case Problem: bottom.jpg, bottomleft.jpg, bottomright.jpg, caltxt.css, css.css, ccc.jpg, febtxt.htm, left.jpg, modernizr-1.5.js, right.jpg, tab.jpg, tabred.jpg, top.jpg, topleft.jpg, and topright.jpg

    The Chamberlain Civic Center  Lewis Kern is an events manager at the Chamberlain Civic Center in Chamberlain, South Dakota. The center is in the process of updating its Website, and Lewis has asked you to work on the pages detailing events in the upcoming year. He's asked you to create a calendar page for the month of February. Lewis wants the page design to catch the reader’s eye and so he suggests that you create a Web table with a background showing a spiral binding. The spiral binding graphic must be flexible to accommodate calendars of different sizes, so you’ll build the borders for this image by nesting the February calendar table within eight div elements. The February calendar must list the following events:

    - Every Sunday, the Carson Quartet plays at 1:00 pm ($8)
    - February 1, 8:00 pm: Taiwan Acrobats ($16/$24/$$36)
    - February 5, 8:00 pm: Joey Gallway ($16/$24/$36)
    - February 7-8, 7:00 pm: West Side Story ($24/$36/$64)
    - February 10, 8:00 pm: Jazz Masters ($18/$24/$32)
    - February 13, 8:00 pm: Harlem Choir ($18/$24/$32)
    - February 14, 8:00 pm: Chamberlain Symphony ($18/$24/$32)
    - February 15, 8:00 pm: Edwin Drood ($24/$36/$44)
    - February 19, 7:00 pm: The Yearling ($8/$14/$18)
    - February 21, 8:00 pm: An Ellington Tribute ($24/$32/$48)
    - February 22, 8:00 pm: Othello ($18/$28/$42)
    - February 25, 8:00 pm: Madtown Jugglers ($12/$16/$20)
    - February 28, 8:00 pm: Ralph Williams ($32/$48/$64)
    - March 1, 8:00 pm: Othello ($18/$28/$42)

    Lewis wants the weekend events (Friday and Saturday night) to be displayed with a light red background. A preview of the page you'll create is shown at the end of this write-up.

    Complete the following:
    1. In your text editor, open the caltxt.css and febtxt.htm files from the tutoril.05\case2 folder. Enter your name and the date in the comment section of each file. Save the files as calendar.css and feb.htm, respectively.

    2. Go to the feb.htm file in your text editor. Create links to the calendar.css and ccc.css style sheets.

    3. Scroll down to the events section element. Within the element, insert a table with the class name calendar. Add the table caption Events in February at the CCC to the calendar.

    4. Create a column group for the calendar consisting of two col elements. The first col element should belong to the weekdays class and span five columns. The second col element should belong to the weekends class and span two columns.

    5. Create a table header row group consisting of one row of table headings displaying the three-letter abbreviations for the days of the week, starting with Sun and ending with Sat.

    6. Create a table body row group containing the days in the month of February. The row group should contain five rows and seven columns of the table data cells. There are no spanning
    cells in any of the rows or columns.

    7. Each table data cell should have the following content:
    - The day of the month should be marked as an h3 heading (refer to Figure 5-55 for the starting and ending days in the calendar).
    - On the days when there is a CCC event, enter the event information as a definition list with the name of the event marked as a dt element, and the time and price of the event each marked with a dd element.

    8. Save your changes to the file and then go to the calendar.css file in your text editor. Create a style rule for the calendar table to: a) create separate borders for the different parts of the table with a 5 pixel space between the borders; b) set the font size to 8 pixels; c) set the top margin to 20 pixels, the bottom margin to 5 pixels, and the left and right margins to auto; d) set the padding space to 40 pixels; and e) set the width to 650 pixels.

    9. In the style rule you created in the previous step, add a style rule that specifies multiple background images for the calendar table in the following order:
    - the topleft.jpg image in the top-left corner of the table with no tiling
    - the topright.jpg image in the top-right corner with no tiling
    - the bottomleft.jpg image in the bottom-left corner with no tiling
    - the bottomright.jpg image in the bottom-right corner with no tiling
    - the top.jpg image in the top-left corner, tiled only in the horizontal direction
    - the left.jpg image in the top-left corner, tiled only in the vertical direction
    - the right.jpg image in the top-right corner, tiled only in the vertical direction
    - the bottom.jpg image in the bottom-left corner, tiled only in the horizontal direction.

    10. Create a style rule to center the table caption along the top of the calendar table and do the following: a) set the bottom padding to 10 pixels; b) set the font size to 16 pixels; c) set the kerning to 3 pixels; and d) set the width to 650 pixels.

    11. Set the width of the table columns to 14% of the width of the table. For columns belonging to the weekends class, change the background color to the value (255, 232, 232).

    12. For table heading cells in the table header row group, set the background color to red, the font color to white, and the letter spacing to 5 pixels.

    13. Set the height of the table row within the table header row group of the calendar table to 5%.  Set the height of the table rows within the table body row group to 19% each.

    14. Add a 1-pixel solid gray border to every table data cell within the calendar table. Set the vertical alignment of the cell content to the top of the cell.

    15. Set the font size of h3 headings within the data table cells of the calendar table to 8 pixels.

    16. The paragraphs in the summary section are enclosed within a div element. Create a style rule for this div element to: a) display the contents in a columnar layout with the column width set to 300 pixels; b) set the column gap to 20 pixels and; c) add a 1-pixel solid black divider rule between columns.

    17. Save your changes to the file and then open feb.htm in your Web browser. Verify that the layout and design of page resemble that shown in Figure 5-55. (Note: If you are running Internet Explorer or Opera, you might not see multiple columns in the description of the upcomming Feburary events.)

    18. Submit your completed files to your instructor, in either printed or electronic form, as requested.

    Learn More
  2. CIS 273 Week 8 Assignment Single Page Website

    CIS 273 Week 8 Assignment Single Page Website

    Regular Price: $15.00

    Special Price: $12.00

    CIS 273 Week 8 Assignment Single Page Website


    Deliverables: One (1) Web page and one (1) Cascading Style Sheet (.css), including the image file.


    Imagine that you have just started your own freelancing business. You have been hired to create a Web page for a company of your choice that announces the item of the week, month, or year. (e.g., Car of the Year, Pet of the Month, Sandwich of the Week, etc.)


    1. Create a Cascading Style Sheet (.css) that applies a minimum of background color and font.
    2. Create one (1) Web page and a heading tag that overrides the Cascading Style Sheet (.css) font settings and makes the font of the heading different from the rest of the page.
    3. The page must also include:
    a. An image depicting the item of the week, month, or year.
    b. At least three (3) hyperlinks to Websites of associated interest to the item and a brief description of what they are about.
    Example: Click here to visit Strayer University
    This link will take you to the University’s main page where you can find further information.
    4. At the bottom of the page, create a link that would allow the user to email you with questions using the mailto: tag and your email address.
    Note: When the email opens the subject line should automatically say, "More Information Please".
    5. Create a footer displaying the Copyright symbol (using the character entity reference), the year, and your name.
    Example: © 2012 Mary Smith
    6. Include a piece of JavaScript in the page.


    The specific course learning outcomes associated with this assignment are:
    Describe the structure of the World Wide Web as interconnected hypertext documents.
    Create and validate HTML documents.
    Create presentations using Cascading Style Sheets and DHTML.
    Summarize Web standards in terms of specifications, guidelines, software, and tools.
    Write clearly and concisely about Web design and development using proper writing mechanics and technical style conventions.

    Learn More
  3. CIS 273 Lab Assignment 7 Form Page

    CIS 273 Lab Assignment 7 Form Page

    $12.00

    CIS 273 Lab Assignment 7 Form Page


    Deliverables: One (1) Web page and one (1) Cascading Style Sheet (.css)


    Follow the directions below to complete Lab Assignment 7:
    Note: The CGI bin script does not work for us because we do not have a server to run it on.
    Therefore, we will use the code listed here instead of the .js files.


    In order to have the Submit and Cancel buttons clear the fields, put this line in your code:
    After your <head> tag:
    <meta charset="utf-8" />
    And this line after your <body> tag:
    <form id='sampleform' method='post' action='' >
    The above code will help the fields clear without taking you away from the page.


    1. Re-create the Web page with a form, and create a heading that states your name and the purpose of the page. Example: “Mary Smith’s Sample Form Page” states the purpose of the page.
    2. Create an entry field for:
    a. “Name”.
    b. “Street Address”.
    c. “City”.
    d. “State (abbr.)”.
    3. Create the formstxt.css sheet and apply it to the page.
    4. Enter your city and state as the default values for the fields.
    5. Use local tags on the page to override the .ccs and set the size of the font for “Student Information” to 6 pt.
    6. Create the “Submit” and “Cancel” buttons.
    7. Validate that the buttons clear the name and street address when selected.

    Learn More
  4. CIS 273 Lab Assignment 5 Navigation Bars and Repeated Images

    CIS 273 Lab Assignment 5 Navigation Bars and Repeated Images

    Regular Price: $12.00

    Special Price: $10.00

    CIS 273 Lab Assignment 5 Navigation Bars and Repeated Images


    Deliverable: Four (4) Web pages (the home page and three image pages) and four (4) Cascading Style Sheets (.css) (one for each page).


    Follow the directions below to complete Lab Assignment 5:
    1. Create a home page with navigation bar to the three (3) pages with images listed below and a Cascading Style Sheet (.css) for bisque color and Arial text.
    2. Create a "single image" page with a Cascading Style Sheet (.css) for background image, bisque color, and Arial text.
    3. Create a "top line image" page with Cascading Style Sheet (.css) for background image, bisque color, and Arial text.
    4. Create a "left side image" page with a Cascading Style Sheet (.css) for background image, bisque color, and centered Arial text.

    Learn More
  5. New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 6 Case 1

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 6 Case 1 Sblogger

    Regular Price: $15.00

    Special Price: $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 6 Case 1


    Sblogger Sports enthusiast Steve Lavent is working on a Web site called Sblogger that will contain articles and commentary on the world of sports. He's asked for your help in designing the page on which users can submit their own comments on the articles that Steve posts to his blog. Your job will be to create a prototype for the commentary form, and to include HTML code and CSS styles to help validate user input. A preview of the Web form you'll create is shown in Figure 6-78.


    Complete the following:
    1. In your text editor, open the sblogtxt.htm and commtxt.css files from the tutorial.06\case1 folder included with your Data Files. Enter your name and the date in the comment section of the file. Save the files as sblogger.htm and comments.css, respectively.
    2. Go to the sblogger.htm file in your text editor and review the contents and structure of the document. Link the file to the comments.css style sheet.
    3. Scroll down to the h2 heading title Post Your Comments, and directly below this heading insert a form element with the action www.sblogger/cgi-bin/subcomments using the post method.
    4. Within the form element, create a field set with the name and id commentFS.
    5. Create a label element with the text Username. Within the label element, insert an input box for the username field. Make the field required and add the title Supply your username.
    6. Create a label element with the text E-mail. Within the label element, insert an input box for the email field. Set the data type to email and make the field required. Add the title Supply a valid e-mail address.
    7. Create a label element with the text Password containing an input box for the password field. Set the data type to password and make the field required. Add the title You must provide your password.
    8. Create a label element with the text Comment (500 character limit), placing the parenthetical text on a new line, and within the label element insert a text area box for the commentBox field. Limit the number of characters that can be typed into the text area box to 500 characters.
    9. Add a submit button with the text Submit Comment.
    10. Save your changes to the file and then go to the comments.css file in your text editor. Create style rules for the styles described in the following steps.
    11. Display the field set with a background color of (245, 245, 255). Set the top and bottom margins to 15 pixels and the left and right margins to auto. Add 5 pixels of padding and set the width of the field set to 90%.
    12. Display labels as blocks floated on the left once the left margin is clear of elements. Set the font size to 0.9 em and the width to 100%. Set the top and bottom margins to 5 pixels.
    13. Display input boxes and text area boxes as blocks floated on the right margin. Set the font size to 0.9 em and the width to 55%. Set the left and right margins to 10 pixels. In addition, set the height of text area boxes to 150 pixels.
    14. Display the submit button as a block once both margins are clear. Do not float the submit button. Set the dimensions of the button to 200 pixels wide by 30 pixels high.Set the top and bottom margins to 5 pixels, and the left and right margins to auto.
    15. When input boxes and text area boxes receive the focus, change the background color to the value (225, 225, 240).
    16. When input boxes receive the focus and are valid, change the background color to (225, 240, 225) and display the background image go.png in the bottom-right corner of the box with no tiling. Resize the background image so that it is contained within the input box.
    17. When input boxes receive the focus and are invalid, change the background color to (240, 225, 225) and display the background image stop.png in the bottom-right corner of the box with no tiling. Resize the background image so that it's contained within the input box.
    18. Close the style sheet file, saving your changes.
    19. Open sblogger.htm in your Web browser and test the form. Verify that you cannot leave the username, email, and password fields blank and still submit the form. Also verify that the form is rejected if an invalid e-mail address is submitted in the email field.
    20. If you have access to the Google Chrome browser, test the Web page in that browser and verify that the title text you entered for the input boxes in Steps 5 through 7 is included in the error box supplied by the browser when those input boxes fail the validation test.
    21. Submit your completed files to your instructor, in either printed or electronic form, as requested.

    Learn More
  6. New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 1 dessertWeb

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 1 dessertWeb

    Regular Price: $15.00

    Special Price: $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 1 dessertWeb


    dessertWeb Amy Wu has asked for your help in redesigning her Web site, dessertWeb, taking advantage of some of the new CSS3 styles. The dessertWeb Web site is a cooking site for people who want to share dessert recipes and learn about cooking in general. In addition to redesigning the site’s appearance, she wants you to create a print style sheet so that users can easily print out recipes and ingredient lists without having to print the headers, footers, and navigation lists that appear on each Web page. Figure 8-64 shows a preview of the screen version of the page.


    Complete the following:
    1. In your text editor, open the recipetxt.htm and dweffectstxt.css files from the tutorial.08\case1 folder included with your Data Files. Enter your name and the date in the comment section of each file. Save the files as recipe.htm and dweffects.css, respectively.
    2. Go to the dweffects.css file in your text editor. Create a style rule for the body element to add two box shadows. One shadow should be placed on the right edge of the page body with the color value (211, 211, 211) and an opacity of 0.5. Set the horizontal offset to 10 pixels, the vertical offset to 0 pixels, and the blur to 15 pixels. Create the same drop shadow on the left edge of the page body as well.
    3. Apply the following style rules to each list item in the horizontal navigation list of the page header: a) set the background color to the value (224, 238, 238); b) add rounded corners 10 pixels in radius; and c) create two inset box shadows: one white shadow located in the upper-left corner offset 3 pixels in the horizontal and vertical direction with a blur of 2 pixels, and the other, a shadow in the lower-right corner with a color value of (147, 207, 207) offset 5 pixels in the horizontal and vertical direction with a blur of 5 pixels.
    4. Add box shadows to the article element with the following properties: a) create an inset box shadow in the lower-right corner with a color value of (171, 171, 171), offset 15 pixels in the horizontal and vertical direction, and with a blur of 75 pixels; and b) create an external shadow located in the lower-right corner with a color value of (101, 101, 101), offset 5 pixels in the vertical and horizontal direction with a blur of 5 pixels.
    5. Add a horizontal background gradient to the blockquote element with the following properties: a) set the gradient to go from the left to the right starting with the color value (166, 230, 230), having a color stop at the 5% point with a value (231, 231, 231), and ending with the color value (255, 255, 255) 15% of the way across the block quote; b) create the same color gradient using the WebKit gradient() function with a color stop for the middle color occurring at the 33% point; and c) using the Internet Explorer Gradient filter, create a horizontal gradient that starts with the hexadecimal color value DEF4F4 and ends with the value FFFFFF.
    6. Save your changes to the file, and then return to the recipe.htm file in your text editor. Add a link to the dweffects.css style sheet file. Specify that the dwlayout.css and dweffects.css style sheets should be used with screen devices.
    7. Save your changes to the document, and then view the page in your Web browser. Verify that the appearance of the page resembles that shown in Figure 8-64. (Note: If you are using Internet Explorer version 8 or earlier, your page will show only the gradient effect around the block quotes, and the gradient will go from light teal to white.)
    8. Figure 8-65 shows a preview of the printed version of the recipe page, displaying the recipe description and ingredients on the first page and the directions on the second page. In your text editor, open the dwprinttxt.css file from the tutorial.08/case1 folder. Enter your name and the date in the comment section of the file, and then save it as dwprint.css.
    9. Set the page size of the printout to 8.5 3 11 inches in portrait orientation with a margin of 0.5 inch.
    10. Hide the following page elements on the printout: page header, left section, right section, all navigation lists, the aside element, the page footer, the h2 element nested within a heading group, and the last paragraph in the article element.
    11. Set the font size of all h1 headings to 200% with a bottom margin of 0.2 inches. Set the font size of all h2 elements to 150% with a top margin of 0.5 inches.
    12. Set the line height of all list items to 1.5 em.
    13. Set the left margin of all ordered lists to 0.5 inches, displaying a decimal value.
    14. Set a page break to always occur before the last h2 element in the page.
    15. Save your changes to the file, and then return to the recipe.htm file in your text editor. Add a link to the dwprint.css style sheet file, setting the style sheet to be used with a print device.
    16. Save your changes to the document, and then view the printed version of the file or preview the printed version in your Web browser. Verify that the contents and layout resemble that shown in Figure 8-65.
    17. Submit your completed files to your instructor.

    Learn More
  7. New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 10 Case 3 MidWest Student Union

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 10 Case 3 MidWest Student Union

    Regular Price: $15.00

    Special Price: $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 10 Case 3 MidWest Student Union


    MidWest Student Union Sean Lee manages the Web site for the student union at MidWest University in Salina, Kansas. The student union provides daily activities for the students on campus. As Web site manager, part of Sean's job is to keep the Web site up to date on the latest activities sponsored by the union. At the beginning of each week, she revises a set of seven Web pages detailing the events for each day in the upcoming week.
    Sean would like the Web site to display the current day's schedule in an inline frame within the Web page titled Today at the Union. To do this, her Web page must be able to determine the day of the week and then load the appropriate file into the frame. She would also like the Today at the Union page to display the current day and date. Figure 10-39 shows a preview of the page she wants you to create.


    Sean has created the layout of the page, and she needs you to write the scripts to insert the current date and the calendar of events for the current day. To assist you, she has located two functions:
    • The showDate() function returns a text string containing the current date in the format Weekday, Month Day, Year. The function has no parameter values.
    • The weekDay() function returns a text string containing the name of the current weekday, from Sunday through Saturday. This function also has no parameter values.
    The two functions are stored in an external JavaScript file named functions.js. The daily schedules have been stored in files named sunday.htm through saturday.htm.


    Complete the following:
    1. Use your text editor to open the todaytxt.htm file from the tutorial.10\case3 folder included with your Data Files. Enter your name and the date in the comment section of the file and save it as today.htm.
    2. In the head section just above the closing </head> tag, insert a script element accessing the functions.js file.
    3. Scroll down the file and locate the div element with the id dateBox. Within this element insert a script element. The script should run the following two commands:
    a. Write the following HTML code to the Web page:
    Today is<br/>
    b. Write the text string returned by the showDate() function to the Web document.
    4. Scroll down the file and locate the h1 heading with the text Today at the Union. Within the empty paragraph that follows this heading, insert another script element. Within the script element, do the following:
    a. Insert the following multiline comment:
    Display the daily schedule in an inline frame.
    Daily schedules are stored in the files sunday.
    htm through saturday.htm.
    b. Insert a command to write the HTML code
    <iframe src='weekday.htm'></iframe>
    to the Web page, where weekday is the text string returned by the weekDay() function.
    5. Save your changes to the document.
    6. Open today.htm in your Web browser. Verify that it shows the current date and that the daily schedule matches the current weekday.
    7. If you have the ability to change your computer's date and time, change the date to different days of the week and reload (not simply refresh) the Web page. Verify that the date and the daily schedule change to match the new date you selected. Debug your code as necessary.
    8. Submit your completed files to your instructor.

    Learn More
  8. Willet Creek Golf Course Landscape Orientation

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 2 Willet Creek Golf Course

    Regular Price: $15.00

    Special Price: $12.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 8 Case 2 Willet Creek Golf Course


    Willet Creek Golf Course Willet Creek is a popular golf course resort in central Idaho. You’ve been asked to work on the design of the resort’s Web site by Michael Carpenter, the head of promotion for the resort. He would like you to add some CSS3 visual effects for drop shadows and gradients. Figure 8-66 shows a preview of the screen version of the Web page.


    Complete the following:
    1. In your text editor, open the willettxt.htm and wceffectstxt.css files from the tutorial.08\case2 folder included with your Data Files. Enter your name and the date in the comment section of each file. Save the files as willet.htm and wceffects. css, respectively.


    2. Go to the wceffects.css file and create a shadow effect for the body element. The effect should contain two box shadows, both with a color value of (31, 61, 31) and an opacity of 0.9. Place the first shadow with a horizontal offset of 20 pixels, a vertical offset of 0 pixels, and a blur of 25 pixels. Do the same for the second shadow, except place the shadow with a horizontal offset of 220 pixels.


    3. Set the opacity of the div elements nested within the aside elements to 75%. Use both the CSS3 opacity style and the IE Alpha filter. Add a box shadow that has a color value of (101, 101, 101) with an opacity of 0.7. Set the horizontal and vertical offsets to 5 pixels and the blur to 10 pixels. You do not have to add an IE filter for the box shadow.


    4. Save your changes to the file, and then return to the willet.htm file in your text editor. Add a link to the wceffects.css style sheet file, using the style sheet for screen devices that have a minimum width of 501 pixels. Add the same media query for the wclayout.css style sheet file.


    5. Use an Internet Explorer conditional comment for versions of IE before version 9 to link to the wclayout.css and wceffects.css style sheet files for screen devices.


    6. Save your changes to the document, and then open the willet.htm file in your Web browser. Verify that the appearance and layout of your page resemble those shown in Figure 8-66.


    7. Many golfers playing the courses at Willet Creek like to receive information and advice about each hole. Michael would like you to create a mobile version of the Web page so that golfers with mobile devices can view information about the course during their rounds. Figure 8-67 shows a preview of the Web app you’ll create.


    8. Open the wcmobiletxt.css file from the tutorial.08/case2 folder in your text editor. Enter your name and the date in the comment section of the file, and then save it as wcmobile.css.


    9. Within the style sheet file, add a style rule to hide the navigation list in the header, the inline image in the header, the main section, the aside
    element, and the page footer.


    10. Set the background color to the value (107, 140, 80).


    11. For the header element, create a style rule to: a) change the background color to the value (151, 201, 151) with the image file willet.jpg placed in the left-center of the background with no tiling; b) set the size of the background image to contain; c) set the width to 100%; and d) set the height to 50 pixels.


    12. The navigation list containing links to each of the 18 holes in the Grand Course has the id holes. Create a style rule to set the width of this navigation list to 100%.


    13. For h1 elements within the holes navigation list, create a style rule to: a) set the font size to 25 pixels; b) set the font color to white; c) set the margin to 15 pixels; and d) center the text of the heading.


    14. For list items in the holes navigation list, create a style rule to: a) display the items as blocks; b) add the background image file arrow.png to the right-center of the background with no tiling; c) set the width to 60% and the height to 50 pixels; d) add top and bottom margins of 5 pixels, and add left and right margins of auto; e) add a 1-pixel-wide solid white border to each list item and create rounded borders with a radius of 10 pixels; and f) add inset box shadows to the list items with a color value of (51, 51, 51) and an opacity of 50% (the inset shadows should appear in the lowerleft corner of each list item with a horizontal offset of 10 pixels, a vertical offset of 5 pixels, and a blur of 20 pixels).


    15. For hypertext links within each list item, add a style rule to: a) display the link as blocks; b) set the width to 100% and the line height to 50 pixels; c) set the font color to white; and d) horizontally center the text of the link.


    16. For odd-numbered list items, set the background color to the value (187, 105, 123). (Hint: Use the pseudo-class nth-of-type(odd).) For even-numbered list items, set the background color to the value (150, 80, 100).


    17. The preceding styles will be applied by default to the page in portrait orientation. Create an @media rule for the page in landscape orientation.


    18. Add the following style rule for list items displayed in landscape orientation: a) set the width to 30%; b) float the list items on the left; and c) set the margins to 5 pixels.


    19. Save your changes to the style sheet, and then return to the willet.htm file in your text editor.


    20. Within the willet.htm file, insert a viewport meta element.


    21. Create a link to the wcmobile.css file to be accessed by only screen devices with maximum widths of 500 pixels.


    22. Save your changes to the file, and then open the willet.htm file in your mobile device or with your browser window resized to a width of less than 500 pixels. Verify that for smaller screen widths, the mobile version of the page is displayed. Further verify that the layout of the links to individual holes changes depending on whether the page is in portrait or landscape orientation.


    23. Submit your completed files to your instructor.

    Learn More
  9. New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 2 JSWorks

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 2 JSWorks

    Regular Price: $25.00

    Special Price: $20.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 2 JSWorks


    Data Files needed for this Case Problem: js.css, jslogo.png, modernizr-1.5.js, nodestxt.htm, tree.css, treetxt.js


    JSWorks Jorge Soto is the owner and administrator of JSWorks, a Web site containing JavaScript tutorials, tips, and specialized apps. Jorge is working on a multipage tutorial concerning the creation and use of document nodes. You are helping Jorge maintain his Web site. You've volunteered to work on his Web page that describes the appearance of the document node tree. Jorge would like you to include a node tree that is based on the article he's writing so that visitors to his site can see the complete appearance of the node tree for a sample HTML fragment. Figure 14-67 shows a preview of the Web page you'll complete for Jorge.


    The JavaScript program you'll design will need to use recursion to navigate through the entire structure of Jorge's article. As it proceeds through the article, it will record each element, attribute, and text node and display those nodes in a nested list alongside the article text. The CSS styles for the nested list already have been created for you; your only job will be to generate the HTML code of the nested list. Jorge also wants your code to keep a running count of the total number of nodes, element nodes, attributes, and text nodes, including text nodes containing only white space.
    Complete the following:
    1. Using your text editor, open nodestxt.htm and treetxt.js from the tutorial.14\case2 folder. Enter your name and the date in the comment section, and then save the files as nodes.htm and tree.js, respectively.
    2. Go to the nodes.htm file in your text editor and add a link element to connect the document to the tree.css style sheet. Also add a script element to connect the file to the tree.js JavaScript file.
    3. Take some time to study the contents and structure of the document and then close the file, saving your changes.
    4. Go to the tree.js file in your text editor. Declare the following global variables: nodeCount to keep a running count of all of the nodes in the source document; elemCount to count the element nodes; attCount to count the attribute nodes; textCount to count the text nodes; and wsCount to count the text nodes containing white space only. Set the initial value of all of these variables to 0.
    5. Insert a command to run the setup() function when the page is initially loaded by the browser.
    6. Create the writeElemLI() function. The purpose of this function is to create a single list item for the node tree diagram based on the contents of an element node. The structure of the list item is shown in Figure 14-68.
    The function has two parameters: elemNode, which represents the element node from the source document on which the list item is based, and nestedList, which represents the nested list that the list item will be appended to. Add the following commands to the function:
    a. Create a list item element named liElem containing the text string +--.
    b. Create a span element named spanElem. Set the class attribute of the span element to elemLI. (Hint: Use the className property to set the value of the class attribute.)
    c. Declare a variable named elemText setting its initial value to the text string <elem where elem is the node name of the element specified in the elemNode parameter.
    d. Next you'll examine all of the attribute nodes for the element specified by the elemNode parameter. Create a for loop to go through the nodes in the attributes collection for the elemNode parameter. Each time through the loop increase the value of the nodeCount and attCount variables by 1. Also add the following text string to the value of the elemText variable att='value'
    where att is the node name of the attribute node and value is the node value of the attribute node.
    e. After the for loop completes, append the text string > to the value of the elemText variable.
    f. Create a new text node named elemTextNode containing the text of the elemText variable.
    g. Append elemTextNode to spanElem; append spanElem to liElem; and finally, append liElem to nestedList.
    7. Create the writeTextLI() function. The purpose of this function is to create a single list item for the node tree diagram based on the contents of a text node. The structure of the list item will be one of the two structures shown in Figure 14-69.
    The function has two parameters: textNode, which represents the text node from the source document on which the list item is based, and nestedList, which represents the nested list that the list item will be appended to. Add the following commands to the function:
    a. Create the liElem variable for a list item element node containing the text string +--.
    b. Create the spanElem variable for a span element node.
    c. Store the node value of the textNode parameter in the variable textString.
    d. Jorge has provided a function named isWhiteSpaceNode() to determine whether
    a text node represents white space or not. Call the isWhiteSpaceNode() function using textString as the parameter value.
    e. If the isWhiteSpaceNode() function returns the value true, then: i) increase the value of the wsCount variable by 1; ii) set the class name of spanElem to wsLI; and iii) set the inner HTML of spanElem to the text string #text.
    f. If the isWhiteSpaceNode() function returns the value false, then: i) set the class name of spanElem to textLI; and ii) set the inner HTML of spanElem to the value of the nodeValue property for the textNode parameter.
    g. Append the spanElem node to the liElem node, and then append the liElem node to the nestedList parameter.
    8. Create the makeTree() function. The purpose of this function is to recursively generate all of the nested lists contained in the node tree diagram. The function has two parameters: sourceNode, which represents the current node in the source document being added to the node tree diagram, and nestedList, which represents the nested list in the tree diagram that is being written. Add the following commands to the function:
    a. Increase the value of the nodeCount variable by 1.
    b. Using the nodeType property, determine whether sourceNode represents an element node or a text node. If it represents an element node, increase the value of the elemCount variable by 1 and call the writeElemLI() function using sourceNode and nestedList as parameter values. If it represents a text node, increase the value of the textCount variable by 1 and call the writeTextLI() function using sourceNode and nestedList as parameter values.
    c. Use the childNodes.length property value to determine whether sourceNode contains any child nodes. If it does, then do the following: i) declare the newList variable containing an element node for the ol element; ii) store the text string | in newList; iii) loop through all of the child nodes for sourceNode, and for each child node call the makeTree() function using the child node and newList as the values for the sourceNode and nestedList parameters; and iv) after the loop has finished, append newList to nestedList.
    9. Create the setup() function. The purpose of this function is to set up the node tree diagram and report the results. The function has no parameters. Add the following commands to the function:
    a. Declare the sourceNode variable referencing the article element with the id main in the current document.
    b. Declare the treeBox variable containing an aside element node. Set the id of treeBox to treeBox and set the innerHTML property to h1 Node Tree </h1>.
    c. Declare the newList variable containing an ol element node, and then call the makeTree() function using sourceNode and newList as parameter values.
    d. Append newList as a child of treeBox.
    e. Append treeBox as a child of the section element with the id main.
    f. Using the innerHTML property, display the values of the nodeCount, elemCount, attCount, textCount, and wsCount variables within the span elements whose ids are totalNodes, elemNodes, attNodes, textNodes, and wsNodes, respectively.
    10. Use comments to document your JavaScript code throughout the program.
    11. Save your changes to the file, and then load nodes.htm in your Web browser. Verify that a node tree similar to that shown in Figure 14-67 is displayed alongside Jorge's article, and that the article contains 247 total nodes, 99 element nodes, 8 attribute nodes, and 140 text nodes, of which 56 are white space nodes. (Note: Safari running under iOS may report 57 white space nodes.)
    12. Submit your completed files to your instructor, in either printed or electronic form, as requested.

    Learn More
  10. New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 3 Sporting Abstract and Statistical Review

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 3 Sporting Abstract and Statistical Review

    Regular Price: $25.00

    Special Price: $20.00

    New Perspectives on HTML, CSS, and Dynamic HTML 5th edition Tutorial 14 Case 3 Sporting Abstract and Statistical Review



    Data Files needed for this Case Problem: gradient.png, modernizr-1.5.js, nfltxt.htm, sasr.css, sasrlogo.png, stats.js, table.css, tabletxt.js

     

    Sporting Abstract and Statistical Review Walter Delacreaux is the owner and operator of Sporting Abstract and Statistical Review, a new blog and forum to report on and analyze data from the world of sports. Walter wants to fill his Web site with useful tables that other people who share his enthusiasm for statistics can review and study. He wants these tables to be as interactive as possible. One feature he wants to add to his tables is the ability to sort them in a different order by clicking a column heading. Figure 14-70 shows a preview of the Web page you'll create for Walter.
    Walter has stored statistics about quarterbacks, running backs, wide receivers, kick returners, and punt returners in a set of multidimensional arrays. He also has created design styles for the stats table that he wants to appear on his Web page. Your job will be to write the code that generates the node tree for the Web table, and to provide commands to sort the contents of that table when a user clicks one of the table heading cells. Walter wants the table to be sorted by default in descending order, but users should be able to change the sort direction by clicking the same column heading twice in succession. Walter also has provided buttons to allow users to switch from one category of player to another.
    Complete the following:
    1. Using your text editor, open the nfltxt.htm and tabletxt.js files from the tutorial.14\case3 folder. Enter your name and the date in the comment section of each file, and then save them as nflstats.htm and table.js, respectively.
    2. Take some time to view the contents of the nflstats.htm, table.js, and stats.js files, noting the structure of the HTML document and the global variables and functions in the two JavaScript files.
    3. Return to the nflstats.htm file in your text editor, and then add a link element to connect the file to the table.css style sheet file. Add script elements to connect to the stats.js file followed by the table.js file. Save your changes to the file.
    4. Go to the table.js JavaScript file. Below the comment section, declare the following global variables:
    a. caption, which is used to store the text of the table caption. Set its initial value to the value of the qbStatsCaption variable.
    b. head, which is used to store the array of column headings. Set its initial value to the value of the qbStatsHead variable.
    c. sortIndex, which is used to store the column index of the table column by which the stats table will be sorted. Set its initial value to the value of the qbStatsSort variable.
    d. stats, which is used to store the multidimensional array of player statistics. Set its initial value to the value of the qbStats variable.
    e. sortDown, which is used to indicate whether the table is sorted in descending or ascending order. Set its initial value to true.
    5. Add a command to run the makeStatsTable() function when the page is loaded by the browser.
    6. You’ll create the Web table with separate functions for each part of the table. The first function you’ll create is the createTableCaption() function, which is used to create the structure of the table caption. The function has two parameters, table and caption, which are used for the table element node and the caption text, respectively. Have the function create the element node <caption>caption</caption> where caption is the value of the caption parameter, and then append that element node to the table parameter.
    7. Create the createTableColumns() function. The purpose of this function is to create the structure of the colgroup element. The function has two parameters: table, which represents the table element, and cols, which is an integer containing the number of columns in the column group. Use a for loop to generate the node structure <colgroup> <col /> <col class=”sortColumn” /> <col /> … </colgroup>
    where the number of nested col elements is equal to the value of the cols parameter. Note that Walter wants the column by which the table is sorted to be given the class name sortColumn. Therefore, within your for loop, test each index number to determine whether it equals the sortIndex variable. If it does, add the class attribute to the col element. Append the node structure to the table parameter.
    8. Create the createTableHead() function. The purpose of this function is to write the table header. The function has two parameters: table for the table element and cols for the number of columns in the header. Use a for loop to create the node structure <thead> <tr> <th id=”1sortcolumn”>head[1]</th> <th id=”2sortcolumn”>head[2]</th> … </tr> </thead> where head[1], head[2], etc., are the values from the head array global variable you declared in Step 4. Append the node structure to the table parameter.
    9. Create the createTableFoot() function. The purpose of this function is to write the table footer. The function has two parameters, table and cols, and creates the node structure
    <tfoot> <tr> <th colspan=”cols”> Stats compiled by SASR &copy; 2015. All rights reserved. </th> </tr> </tfoot> where cols is the value of the cols variable. (Hint: You must use the colSpan property to reference the colspan attribute.) Append the node structure to the table parameter.
    10. Create the createTableBody() function. The purpose of this function is to write the rows and columns of the table body. The function has three parameters: table representing the Web table, rows, which contains the integer value of the number of rows in the table body, and cols, which contains the integer value of the number of cells within each table row. Use a nested for loop to generate the node structure <tbody> <tr> <td class=”textCell”>stats[0][0]</td> <td class=”numCell”>stats[0][1]</td> … </tr> <tr> <td class=”numCell”>stats[1][0]</td> … </tr> … </tbody>
    where stats[0][0], stats[0][1], etc., are the values from the stats multidimensional array you declared in Step 4. Note that for each td element, you add a class attribute with the value textCell or numCell based on whether the value displayed in the cell is a number or a text string. Use the isNumeric() function provided in the table.js file to make this determination. Append the node structure to the table parameter.
    11. Create the makeStatsTable() function. The purpose of this function is to sort the statistical values, put the different parts of the table together, and append the table to the Web document. Add the following commands to the function:
    a. Declare a variable named rows equal to the length of the stats array.
    b. Declare a variable named cols equal to the length of the head array.
    c. Use the JavaScript sort method along with the colSort() function to sort the contents of the stats array.
    d. Create a table element named tableElem with the id statsTable.
    e. Call the createTableCaption(), createTableColumns(), createTableHead(), createTableFoot(), and createTableBody() functions using tableElem as the parameter value for the table parameter and caption, rows, and cols as the values for the caption, rows, and cols parameters, respectively, to construct the entire node structure of the Web table.
    f. Declare the statsBox variable, referencing the element in the Web document with the id statsBox.
    g. Replace the first child node of statsBox with the tableElem element node.
    12. Save your changes to the file, and then load nflstats.htm in your Web browser. Verify that the content of the Quarterbacks table is displayed on the page.
    13. Next, you’ll enable users to sort the table by different columns. Return to the table.js file in your text editor. Go to the createTableHead() function. For each th element node generated in your for loop, add an onclick event handler to run the changeDirection() function when clicked.
    14. Create the changeDirection() function. The purpose of this function is to either
    change the sorting direction of the currently selected column, or sort the table by a
    newly selected column. Add the following commands to the function:
    a. Use the parseInt() function to extract the index number from the currently selected column. (Hint: Use the this keyword.)
    b. If the index number is equal to the value of the sortIndex global variable you created in Step 4 (indicating that the user has clicked the current sort column), use the negation operator to change the Boolean value of the global sortDown variable from false to true or from true to false. Otherwise, change the value of the sortIndex variable to the index number of the currently selected column.
    c. Call the makeStatsTable() function to regenerate the statistics table.
    15. Save your changes to the file, and then reload nflstats.htm in your Web browser. Verify that you can change the sorting column by clicking each column heading, and that you can toggle the sorting direction by clicking each column heading in succession.
    16. Next, you’ll enable users to select different statistics tables to view in the Web page. Return to the table.js file in your text editor. Create the changeTable() function with a single parameter: statsCategory. The statsCategory parameter will contain a text string indicating the statistics table to view. Add the following commands to the function:
    a. Use the eval() function to change the values of the global variables caption, head, sortIndex, and stats to the value of the statsCategoryCaption, statsCategoryHead, statsCategorySort, and statsCategory variables, respectively, where statsCategory is the value of the statsCategory parameter.
    b. Change the value of the sortDown global variable to true.
    c. Call the makeStatsTable() function to regenerate the statistics table.
    17. Add informative comments to the code in your file and then close the file, saving your changes.
    18. Return to the nflstats.htm file in your text editor. Locate the input elements for the five table buttons, and then add an onclick attribute to each input button to run the command changeTable(stats) where stats is either qbStats, rbStats, wrStats, krStats, or prStats depending on whether the Quarterbacks, Running Backs, Wide Receivers, Kick Returners, or Punt Returners button is clicked.
    19. Save your changes to the file, and then reload nflstats.htm in your Web browser. Verify that you can load different statistics tables by clicking the five statistical category buttons.
    20. Submit your completed files to your instructor, in either printed or electronic form, as requested.
    Learn More

Items 11 to 20 of 66 total

per page
Page:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Grid  List 

Set Ascending Direction