close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How easy is this

Thread began 1/14/2012 10:35 pm by newimage96814918 | Last modified 2/24/2012 10:22 am by Jason Byrnes | 3047 views | 14 replies |

newimage96814918

How easy is this

I'm fairly new to php but I know It's done a lot just not sure how, I want to do a classic image swap on rollover but from a recordset. I have list of artist names from database and on rollover name link I want to show the image form that artist in the image box next to list, then on click will just go to detail page as usual. Is this somthing that done easy enough with datassist and dreamweaver, Or will it take a bit of hand coding, I tried googling but I must not be saying it right, any ideas?

Sign in to reply to this post

Ray BorduinWebAssist

You would do it by hand with a little bit of javascript.

It sounds like you want to show an image associated with a rollover of the name... most likely you would add an onmouseover="" javascript link to the <a> tag that you have linked and have code that updates the image src.

The code might look like:

<a href="yourpage.php?artist=<?php echo($row_rs['artist_id']); ?>" onmouseover="document.getElementById('imageid').src = '<?php echo($row_rs['artist_image_location]); ?>'"><?php echo($row_rs['artist_name']); ?></a>
Sign in to reply to this post

newimage96814918

Thanks Ray! I'll play around with that. Ya I will have a page that will list the artist names in a repeat region and will show one image on the page about like a detail page size, then as the link is moused over the detail image will show that artists image on the page, but then clicked will go off to detail page for that artist with image and bio and such

Sign in to reply to this post

newimage96814918

I cannot get it to work

I'm not sure if I got the concept yet I started playing with this with no avail.
do i need to have the image come from the same recordset as the list of names or different. I tried both but I'm not getting it right.
if I use the get element by id in the link haw do I call it in the image to filter it.
any more Ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

the idea is that you have an image tag with an id set up like:

<img src="blankimage.jpg" id="imageid" />

then in the link, you use the onmouseover event to reset the src attribute of the image tag:

onmouseover="document.getElementById('imageid').src = '<?php echo($row_rs['artist_image_location]); ?>'


the image should be coming from the same recordset as the names

If you send a link where i can see what you have tried and a copy of the page so i can see the code, i can probably tell what is not being set up correctly.

Sign in to reply to this post

newimage96814918

Thanks Jason!
Attached will be the page.
I'm sure I just got some syntax wrong. I need the link on hove to show the picture associated with that artist name which is being hovered and on click it goes to detail page all works except fpr that hover swap.

Tracy

Attached Files
Artists.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you have the image source set to use the artist picture already:

<img src="uploads/<?php echo $row_rsartistlist['artist_pict']; ?>" name="imageid" width="300" class="rightimmain" id="imageid" />


it is usiong the same image as the mouseover code:
onmouseover="document.getElementById('imageid').src = '<?php echo $row_rsartistlist['artist_pict']; ?>',1)"


the mouse over is just swapping it with the same image

Sign in to reply to this post

newimage96814918

I changed it to just a static image and still nothing, no swap is happening, do I need some extra java code do do this? I do have a swap image on the page already using static images farther down on the page, in a div that is being included. Is there some conflct here do I neesd extra java code in head for my new swap or is it using the code already there?
If you need any more of those files let me know.

Tracy

Sign in to reply to this post

Jason ByrnesWebAssist

please send a link where i can see the problem.

Sign in to reply to this post

newimage96814918

here is the link:
Artists.php

Thanks!

Tracy

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...