File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Help with image divs ref CSS and Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help with image divs ref CSS and Javascript" Watch "Help with image divs ref CSS and Javascript" New topic

Help with image divs ref CSS and Javascript

Raphael Zwyer

Joined: Oct 10, 2012
Posts: 1
Need some help here, it's driving me nuts.

Here's the work in progress:

For the images in the gallery (five at a time, right now compiled into one large image) I have the following HTML code:

Javascript file:


There are transparent layers on each side to cover the images not currently in the center.

I would like to have each of the five images as separate CSS background images (faster load, easier managing, better image quality...) and not, as they are now, embedded in HTML, but I don't know how to do it without ending up having to use a separate CSS class or ID for every single image.
How exactly would I reference the images in a simple way (maybe I have to just number them and put them in different folders, one per page, but how...)?!
I'm a newbie, not familiar with Javascript or content management so I'd probably need a concrete example of how HTML, CSS and Javascript work together to reference and load the images plus how that goes together with the forward back function. It would probably be easier for me to understand when using the same ID's and classes in the example.

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Hi, and welcome to the Ranch!

Note that JavaScript is not Java. Moving to a more appropriate forum.
I agree. Here's the link:
subject: Help with image divs ref CSS and Javascript
It's not a secret anymore!