View Full Version : image assistance in javascript

04-14-2015, 03:01 PM
Good Day,
New to Javascript, pulling my hair out!!! this an assignment I need to complete. I have tried using an if and else, then tried using the function code, need to use arrays???. What is the actual code I need to perform this. I can do the html and css part no problem. Any assistance you can provide will be greatly appreciated. Thank you so much! Here is the instructions...

1. Make a page with an image gallery containing at least 6 images and a short sentence or paragraph for each one.

2. When the page first loads, there should be only ONE image showing along with its description in a separate paragraph.
3. There should be either buttons or links (such as >>) to advance forward AND backward through the images. When the user is viewing the last image and clicks to advance, it will show the original image again. The same thing should happen if the user is at the first image and clicks the backwards button- it should display the last image. Every image should also be accompanied with it's corresponding description.
4. There should be a headline above the image gallery describing what the gallery of images is about (random, my summer vacation, where I want to live, my pet goat etc)
5. You should use arrays for the images and descriptions.
6. You should use either DOM and/or innerHTML to change the image displays

04-15-2015, 09:13 AM
as you say you will need to use an array

but it is difficult to assist without doing it all

you will need to attempt the requirements and post your code and we can assist with the specifics

04-15-2015, 09:51 AM
Good Day,
... this an assignment I need to complete ...

Ah, homework. Sorry, you'll need to show that you have at least tried to solve the problem first.

04-15-2015, 12:25 PM
I will try with arrays, have tried with functions and variables. God Bless you! and thank you!