Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

100 pages with rollover effects

Status
Not open for further replies.

renzocj

Programmer
Sep 1, 2011
8
PE
I have a page with 3 little divs for thumbnails and 1 big div for every of the 3 thumbnails images in real size. So I have per page 6 images, thumbnails and real size.

I was trying to script this creating objects for the ID's of every div inside the page related to the product code of the page. (every page shows a dress, so every thumbnail is a different image of the same product).

For example the product "A" is "img001"

so for the page: "img001.html" I would say that the image inside the real size div have an id of "id="img001_big" and the 3 divs thumbanils (instances of the product) would be id="th1_img001" id="th_img002" and id="th_img003".

then using an event I can change the "src" of the "img001_big" to change the real size picture when the users clicks one the thumbnails.

The problem is that I have more than 100 products pages, so don't want to creat more than 400 id's! there must be some other kind of solution, in order to just with a single script create the effect in all pages.

let me know if I need to post all the source code of my project.

Thanks in advance to everyone here for any help!

 
YOU don't need to create 400 ids, you get the server side code do it for you.



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
You don't even need to create 100 pages either.

The real question is how you are making the server deliver the thumbnails, it should be taking care of the ID's by itself.

Your JS script should merely be using what is provided in your thumbnails as a reference and go from there.

The generation of ID's should be done automatically by your server side script.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top