Jump to content

PHP & Javascript to create a rollover image from multiple links


jonw118

Recommended Posts

I'm hoping someone would be kind enough to help me here. First I want to know if I can accomplish this. If so, I am by no means asking you to write my code, but if you could steer me the direction, or give me some pointers I'd really appreciate!

 

Basically I have a script the shows multiple results on the page pulled from the database.

 

The code for the link:

<a href="full_desc.php?id=<? echo $row['id'];?>"><? echo $row['subject'];?></a>

 

Then, for each link displayed it has a photo that displays:

<? if(!empty($row['thumb'])){?>
<img src="admin/<? echo $row['thumb']?>" width="120" height="60" border="1">
<? }?>

 

Now what I want to do is have one main image, so that when you rollover a link that is populated it changes the photo (associated with that link) in the one main image.

 

I'd really, really appreciate any help at all!

 

Thanks.

Link to comment
Share on other sites

Okay this really is more of a HTML/CSS question

 

from the code you have posted you could be able to get this to work, with a little help on the html side.. so here and an example

<A HREF="pages.html" ONMOUSEOVER='rollover.src="overtop.gif"' ONMOUSEOUT='rollover.src="thumb.gif" '>
<IMG SRC="thumb.gif" NAME="rollover" border="0">
</A>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.