Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsHello experts,
I'm doing a little thing as a favor for a friend. She has a gallery page that's created by a php script that reads the item attributes and creates a thumbnail gallery with images. Onmouseover for each image, she wants a certain part of the screen to show a larger image plus a couple pieces of info about it (taken from the db). I was able to make this work as a test by setting up a dummy image to hold the larger image like this:
<img name="rollimg" alt="Big Image" src="img01.jpg" width="400" height="400" border="0"/>
and then putting this code into the head (for a four-item gallery):
<script type="text/javascript">
if (document.images) {
idefault = new Image;
i74341 = new Image;
i74307 = new Image;
i74338 = new Image;
i74334 = new Image;
idefault.src = 'img01.jpg';
i74341.src = 'images/item1.jpg';
i74307.src = 'images/item2.jpg';
i74338.src = 'images/item3.jpg';
i74334.src = 'images/item4.jpg';
} else {
idefault = '';
i74341 = '';
i74307 = '';
i74338 = '';
i74334 = '';
document.rollimg = '';
}
</script>
which is called like this in the gallery itself:
<a href="http://www.gotobigim
There are two shortcomings with what I've done here:
1) There's no way to show any other item attributes (like price, description). It can only change the image. I can read the item attributes I want from the database, but can't display them this way because they are text.
2) This is fine for static pages, but this isn't a static site. I hard-coded the above code in for proof of concept, but it needs to work no matter what the items are.
I don't know how to solve problem #1. Maybe a div could be used instead, or innerHTML?
I have a conceptual solution for problem #2 that I've used before in web apps. I'd need to make the server wait to serve the page until it was completely created by the php. The php would query the database, extract all the info, and create the javascript on the fly, which it would then insert into the page before sending the page to the browser. That's a little more complicated than I'd like to get with this site, since this is an existing site with lots of function includes and I don't like hacking into all that just to accomplish this. (For example, some of the existing functions that are included on every page create output that just gets echoed to the page, but to do it the way I described I'd have to stop that on the gallery page and modify those functions to put their output into variables, which would then be pieced together in the main php script to produce the output, which it could then serve.)
So, I could use some help. The two problems both need to be solved, so I'll split the points if I get a good answer for each of them from two different people, or all points go to one who helps with both the most. I'm not averse to increasing the points. I really need help with this in the next couple days, and anything you can do would really be appreciated.
Thanks,
Utzi
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: carchitectPosted on 2007-06-18 at 00:47:14ID: 19305275
Comments are available to members only. Sign up or Log in to view these comments.