How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask TheDoctor Your Own Question

TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

**For TheDoctor** Need a new improved background function

This answer was rated:

**For TheDoctor** Need a new improved background function similar to the one you did earlier today


More details you can find on

Hello again! Thank you for requesting me.

The PDF you provided is a single page and all it says is to move the JS to a different file. Is that all you need done? Move the background changing code to a separate file while keeping all the other JavaScript code in the index file where it was to begin with?

Customer: replied 3 years ago.
Yea I just need if i press example presPart3 or 4 or 5 it needs to call the js file with the bg imasges function all the other code can stay but the image background function to be in a seperate file.

In the PDF you sent me, the code is presPart1, 2, and 3.

Are you saying that you want to add additional parts, or rename the existing parts? If what you want is to be able to add additional pages, then please let me know.
Customer: replied 3 years ago.
In 0,1,2 i will have different functions. In 3,4,5 will be the Background i need u to do. And I will have 6,7,8 I also will have different functions.

So if you could just do the bg function fo presPart3,4,5
That is not what I need to know.

Will you be adding additional parts? As in, will index.html hae part 0, 1, 2, 3, 4, 5, 6, 7, 8?

Or will there be a DIFFERENT HTML FILE for parts 3, 4, 5, and a completely different HTML file for parts 6, 7, and 8?

Your answer completely changes the JavaScript code. So it is a very important distinction.
Customer: replied 3 years ago.
Yes the index will have additional parts

Hello again!

Please download the files here:

The code for the background is in the background JavaScript file.

I have altered it so that you can have as many pages as you want. Of course, the code needs initialized/called.

First, on line 27 of index.html, you will see:


This tells the background code that there are a total of three pages with backgrounds.

Next, the code needs triggered whenever the page is changed. This is done at index.html at line 130:


Now, let's say that you wanted to add a "Page4". You would change the integer passed into setupBackground to 4. You would also make certain that there is a bg13.jpg, bg14.jpg, and bg15.jpg in the images folder.

You can use this background JavaScript file in any page you want with however many images you want. You just need to 1.) pass to it the number of pages and 2.) call the updateBackground function on page change.

Customer: replied 3 years ago.

can we just change the links Page one: presPart1 to presPart3

Page two: presPart2 to prePart4 , and Page three: presPart3 to presPart5 links, because I have other function that will be called when calling prespart 0,1,2,


and the PresPart0 I just need a plain white background, When I click on it it changed the background too. I just need it to be the plain white background which is called from the bundle.css


I just need the presPart3 presPart4, presPart5 to call the background javascript image function.

That is why I asked if was ADDITIONAL or if you wanted to CHANGE the names. The change is a completely different code that I have to write. And you replied additional, not the change, so I didn't write the code that you are now asking for. I have to rewrite it again. I'll let you know once it is done.
Customer: replied 3 years ago.

Im sorry I thought that I did mentioned that I have additional files and needed to be change.

No, you've only mentioned 3, 4, 5, and made references to pages, which is not the name of a page, but of a link within a page. Then I specifically asked if there were separate files OR just additional items on the index, and you replied additional items on the index. So I wrote the code the opposite way of what you want.

This will be ready shortly.


You need to spend $3 to view this post. Add Funds to your account and buy credits.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience: M.S. in Internet Information Systems
TheDoctor and 5 other Homework Specialists are ready to help you
Customer: replied 3 years ago.

I got an issue when adding pages. After I add pages prespart6,7 etc. The link button doesnt work and it won topen the pages 3,4,5. Here is my whole folder. I just want prespart 3,4,5 to have images all the other pages will be different will have text I want them to be seperate I dont want to have to change nothing in the background.js file that file should just be for pages 3,4,5 all the rest should be able to do whatever

Alright. The last thing you told me was that the presParts would be in different files. They are not, they are all in the same file. So that requires different code. Now that I have seen what you have done, the accurate description is: "All nine presParts are in the same file, the background functionality is to be applied to only three parts: 3, 4, and 5". That was never clear from anything you said.

I would need to know that, as having different parts within the same file means that you need to limit the application of the code to specific parts. Having parts in different files, which is what you told me, means that you can simply apply the code to the page without explicitly limiting its application. These kinds of details and distinctions are critical when programming, which is why I asked about the location of the other parts multiple times. If you are not a professional programmer, I can understand not being as nit-picky as someone like me. But the saying "the devil's in the details" is never more true than with programming.


I've made the changes and here are the files:

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Previous | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX

Meet The Experts:

  • LogicPro



    Satisfied Customers:

    Expert in Java C++ C C# VB Javascript Design SQL HTML
< Last | Next >
  • LogicPro's Avatar



    Satisfied Customers:

    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany


    Satisfied Customers:

    More than 5000 online tutoring sessions.
  • Linda_us's Avatar


    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    Post Graduate Diploma in Management (MBA)
  • Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    Experience with chartered accountancy
  • Bizhelp's Avatar



    Satisfied Customers:

    Bachelors Degree and CPA with Accounting work experience
  • Seanna's Avatar



    Satisfied Customers:

    3,000+ satisfied customers, all topics, A+ work

Related Homework Questions