This is the html, I am only permitted to change the javascript and there are a few things I need to do that I cannot figure out how to do.
-Corresponding full size images for the thumbnails must be preloaded when the application starts
-When a thumbnail is clicked, the corresponding full size image will be shown in the fullsize-image img element with an appropriate alt attribute value (same as the file name e.g. fullsize1)
-The comment control button should read Show Comments
When the full size image is hovered over with the mouse the corresponding description for the image should be displayed in the description div
-The descriptions are provided in an array in the assign1.js file and correspond in order
E.g. descriptions[0] -> thumb1.jpg
-The description div should disappear when the mouse is not hovering on the full size image
-Clicking the Show Comments button should display comments made on the image (if any have been posted) and the value of the button should change to Leave a Comment
-Bonus [2 marks]: Display in the comment area a message if there are no messages for the current image
Clicking the Leave a Comment button should bring up the comment form
-Bonus [3 marks]: prevent the image from changing when the form is displayed
-Comments should be added as li elements within the existing comments ul element
-Comments may only be posted with a valid by (required) name and comment (required) content
-Provide form validation feedback (error messages) so mistakes can be corrected
-Ensure that the error messages are placed in the designated div and that the message colour is red (use the style property for this task)
-The format for displaying posted comments is as follows:
Jon Doe on Oct 3, 2012 said: I love this picture sooooo much!
Be sure the that current date is displayed
-If a comment is successfully submitted it should immediately appear in the comments area
-If the cancel button is clicked, reset and hide the form
-Comments must persist when they are posted
-Comments that have been left must be visible when for any image on consecutive views
-Corresponding full size images for the thumbnails must be preloaded when the application starts
-When a thumbnail is clicked, the corresponding full size image will be shown in the fullsize-image img element with an appropriate alt attribute value (same as the file name e.g. fullsize1)
-The comment control button should read Show Comments
When the full size image is hovered over with the mouse the corresponding description for the image should be displayed in the description div
-The descriptions are provided in an array in the assign1.js file and correspond in order
E.g. descriptions[0] -> thumb1.jpg
-The description div should disappear when the mouse is not hovering on the full size image
-Clicking the Show Comments button should display comments made on the image (if any have been posted) and the value of the button should change to Leave a Comment
-Bonus [2 marks]: Display in the comment area a message if there are no messages for the current image
Clicking the Leave a Comment button should bring up the comment form
-Bonus [3 marks]: prevent the image from changing when the form is displayed
-Comments should be added as li elements within the existing comments ul element
-Comments may only be posted with a valid by (required) name and comment (required) content
-Provide form validation feedback (error messages) so mistakes can be corrected
-Ensure that the error messages are placed in the designated div and that the message colour is red (use the style property for this task)
-The format for displaying posted comments is as follows:
Jon Doe on Oct 3, 2012 said: I love this picture sooooo much!
Be sure the that current date is displayed
-If a comment is successfully submitted it should immediately appear in the comments area
-If the cancel button is clicked, reset and hide the form
-Comments must persist when they are posted
-Comments that have been left must be visible when for any image on consecutive views
these are the few things you cannot figure out how to do?
Unfortunately yes, not so few I guess. My profs teaching style is making us watch him type code... Not so good with the explaining. And I have never used JavaScript before.
yeah, that makes it tough. Can you at least show what you have tried? Few people aroubd here do entire homework assignments - most tend to help out on specific isssues
The bit of javascript on there is all my code, but it doesn't seem to be doing anything. I don't think it will until the alt values are in place. I have asked other classmates and googled this but the only thing I can find is how to create this sort of img gallery using other programs. :S
// Preload each image in the array by creating a new image and
// setting the src property
for (var i = -1) {
imageObj = new Image();
imageObj.src = images[++i];
}
}
this is the closest I've gotten and it still isn't working at all...
Bookmarks