This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
It is sorta covered in the JavaRanch Style Guide.
subject: Help with image divs ref CSS and Javascript
Similar Threads
Ajax, Struts, and a few pesky event based issues
Help with a chess program
Javascript menu and swf file;problems with z-index
how to copy the data one form field to another form field by using check box
Cannot find bean error in any scope