Home > front end >  Js can't change the background image
Js can't change the background image

Time:10-11

Use js to change the background image, under the relative address can't find pictures, CSS () is encapsulated, equivalent to add CSS

CodePudding user response:

Comparing to the path of the error image path with you, if you can amend the path

CodePudding user response:

leaf MAO response: 1/f, reference
error comparing to the path of the image path with you, different words you can modify the path

The path that's right, but I couldn't find the picture

CodePudding user response:

You write path is../img/Slide, but you'll have no project directory img folder

CodePudding user response:

Your screenshots send a file directory

CodePudding user response:

A layer of less path? Should is the path/Yimingbk/img/Slide. JPG

CodePudding user response:

Remove image address in front of../

CodePudding user response:

Var imgBox=[". \ \ testIMG \ \ 1. JPG ",
". \ \ testIMG \ \ 2. JPG ",
". \ \ testIMG \ \ 3. JPG "];


Var array in bjtu in path need two slashes to heart

CodePudding user response:

Local img, js is images on the web, wrong path
  • Related