Gossamer Forum
Home : Products : DBMan : Installation :

Short display, mouseover problem

Quote Reply
Short display, mouseover problem
Hi,
I'm breaking my head about this:
I have in my short display the records, whitch has a foto locked in, marked with a picture of a camera at the end of the short record. For the fun, I made it light up with a mouseover. I thought that would work. But when there are more records with a foto, there are more records in my short display, with a camera. Thats good. Now the problem: When someone goes with his mouse over a camera, the camera must light up, this only happens at the last lowest camera in the display. It make no difference, if you take the first, second or third, by mouseover of all the camera's the last one lights up. I think, this has to do with the repetition of writing the records in the short display, all the camera pictures has the same name and location. But there must be a way to fix this. (Java)
Anyone?????

Look at my problem at www.autorandstad.nl, take 'dealers' and 'alle records'. (Still under construction).

Thanks in advance,
----------

Greetings,
Mart.
Quote Reply
Re: Short display, mouseover problem In reply to
mart,

The problem is that all your images have the same name - "camera". To be able to reference these images separately, they all have to have unique names - "camera1", "camera2", etc. And of course your mouseover function will need to be told which image to use too.

Cheers,
adam

[This message has been edited by dahamsta (edited May 28, 1999).]
Quote Reply
Re: Short display, mouseover problem In reply to
Please take a look at the site, I have only two images, one ordinary and one lightup. They only appear, when someone adds a record, with an URL to his foto. So there could be no camera's in the short display, bus also >100... it's variable. My problem it to highlite the right camera.
Thanks.
-------
Mart.
Quote Reply
Re: Short display, mouseover problem In reply to
mart,

I *did* look at your site. Smile

The problem doesn't come down to the image, you can use the same image in the page as many times as you want, it comes down to the image name. JavaScript sees things in the page as objects, and if you want JavaScript to do something with that object, you have to give it a unique name, just like Perl has different field names in forms. In your page, your images all have the name of "camera", like this:

<img src="camera.gif" name="camera" etc...>

And onmouseover is telling JavaScript to roll the "camera" object in the page. Since there's several objects in the page called "camera", it's just changing the last one it came across. So to fix it, you need to have a different name for each image, and the mouseover in each href tag has to match that.

The only way you can do this is to set up a count somewhere in db.cgi, and do a foreach loop to create a unique name for each image in the document. This way the result would look something like:

<a href="whatever.htm" onmouseover="onmouseover_function('camera1')" onmouseout="onmouseout_function('camera1')"><img src="camera.gif" name="camera1"></a>

<a href="whatever2.htm" onmouseover="onmouseover_function('camera2')" onmouseout="onmouseout_function('camera2')"><img src="camera" name="camera2"></a>

And so on. JPDeni might be better off explaining how to set up that loop, because she's been under the hood of dbMan longer than I have. I'll keep an eye on this thread though, in case you need any more help with the JavaScript stuff.

Over to you Carol... Smile

Cheers,
adam
Quote Reply
Re: Short display, mouseover problem In reply to
Since you are using the new short/long display, you can just use

<a href="whatever.htm"
onmouseover="onmouseover_function('camera$i')"
onmouseout="onmouseout_function('camera$i')">
<img src="camera.gif" name="camera$i"></a>

I don't have any idea how the Javascript works, but this will print out a different number for each of the records.


------------------
JPD





Quote Reply
Re: Short display, mouseover problem In reply to
Thanks Carol.

adam
Quote Reply
Re: Short display, mouseover problem In reply to
Don't know what to say....
Your great.. .. .. .. ..

Thanks,
-------
Mart.
Quote Reply
Re: Short display, mouseover problem In reply to
 Smile Well, there's no way I would have come up with the solution without Adam's understanding of Javascript. One of these days I'm gonna have to learn that stuff. Probably when it's extinct! Wink

You must have one heckuva site by now, Mart!


------------------
JPD





Quote Reply
Re: Short display, mouseover problem In reply to
You MUST take a look, maybe you've some tips, only the 'dealers' part is almost finished, but the rest is far under construction.
You will certenly regognize your hand in it.
--------
Greetings,
Mart.