Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2008, 04:58 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default <a onMouseover=... question

Hi to all...

i have the following code in a table...
code:
*********************************************
<td bgcolor="045C97" align="CENTER">
<a onMouseover="Mens.src='/MenS01.jpg';MainMens.src='/MenB01.jpg'"
onMouseout="Mens.src='/MenS01.jpg'" width="100" height="80">
<img src="/MenS01.jpg" border="1" name="Mens" width="100" height="80"></a><br>
<a onMouseover="Mens.src='/MenS02.jpg';MainMens.src='/MenB02.jpg'"
onMouseout="Mens.src='/MenS02.jpg'" width="100" height="80">
<img src="/MenS02.jpg" border="1" name="Mens" width="100" height="80"></a><br>
</td>

<td align="CENTER" bgcolor="FFFFFF" >

<img SRC="MainMen.jpg" name="MainMens" width="500" height="400">
</td>

<td bgcolor="045C97" align="center" >

<a onMouseover="Mens.src='/MenS07.jpg';MainMens.src='/MenB07.jpg'"
onMouseout="Mens.src='/MenS07.jpg'" width="100" height="80">
<img src="/MenS07.jpg" border="1" name="Mens" width="100" height="80"></a><br>
<a onMouseover="Mens.src='/MenS08.jpg';MainMens.src='/MenB08.jpg'"
onMouseout="Mens.src='/MenS08.jpg'" width="100" height="80">
<img src="/MenS08.jpg" border="1" name="Mens" width="100" height="80"></a><br>
</td>
*******************************************
what I'm trying to figure out is when i mouse over an image i want to read from my DB and get the description so i can make it appear on top of the big image...

to open and read data from the DB is no problem...

i having trouble on how to store the value in the mouseover code...

Hope someone can help me...

thanking you in advance...

Rino


 
Old March 5th, 2008, 05:33 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It depends on what your intent is. If you want to access the database when you mouse over the images you will need to use AJAX to return the data and then display it however you want.

Alternatively, if you are generating the links via some server side code, you could create a javascript function on your page that takes two values:

function displayImage(imgSrc, imgDescription)
{
//set img
//set description
}

then change your server side script so that your links would look like this:

onMouseover="displayImage('/MenS07.jpg', 'Some description')"

does that make sense?


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old March 6th, 2008, 12:11 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

maybe i didn't explain myself right...

I have the following code the works perfect...
Set rs = connHartStores.Execute("sp_GetAllMultipleSigncards '" & Request.QueryString("PromoID") & "'")

If not rs.eof Then
Do until rs.eof

<TD VALIGN="TOP" class="PromoDetail">Flyer Signcards<A HREF="/AllSizes.asp?PromoSize=" rs("PromoSize") &PromoID= rs("PromoID") > server.HTMLEncode(rs("PromoSize")) & </A></TD>
<TD align="middle"><A HREF="/Sizes.asp?PromoSize=" & rs("PromoSize") & "&PromoID=" & rs("PromoID") & ></A></TD>

But this works when I click on it, it gets the info I need from my DB...

I would like to do the same think but with my onmouseover...

Is there a way I can do this...

Thanking you in advance...

Rino


 
Old March 6th, 2008, 01:55 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes. I think what you are looking for is something similar to this:

http://www.dynamicdrive.com/style/cs...ge-viewer/P20/

and the Google SERP found that link on:
http://www.google.com/search?hl=en&r...ge+onMouseOver

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
onmouseover question??? RinoDM Javascript 3 May 30th, 2008 03:01 AM
Question regarding the display of <a> tags in xml tajjyarden XSLT 1 March 21st, 2007 11:54 AM
<asp:menu question paco ASP.NET 2.0 Professional 0 August 22nd, 2006 08:05 AM
<html:option> question Edward King Struts 2 May 4th, 2006 09:14 AM
<xsl:if test="" Question kwilliams XSLT 2 August 9th, 2005 08:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.