#1 (permalink)  
Old 01-12-2006, 04:44 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
change style by image rollover

I can't seem to nail this down. What I need to do rollover an image in one td and change the style of the text in another td. What I have are text links on a page that when rolled over the style sheet says to underline them. That part is ok. What I need to do is when a user rolls over the image in the td next to the text link, the rollover style is applied to the text link and becomes underlined. This is what I have tried. Maybe it's a syntax issue. Thanks.
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
.rolloverStyle {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 14px; color: #2a57a5; text-decoration: none;}
.rolloverStyle:hover {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 14px; color: #2a57a5; text-decoration: underline;}
-->
</style>
</head>
<body>
<table>
<tr>
<td><A href="theurl.html" onMouseOver="document.testLink.style='rolloverStyl e:hover'" onMouseOut="document.all.testLink.style='rolloverS tyle'"><IMG src="imagename.gif" border="1" name="testIcon"></A></td>
<td><div id="testLink"><A href="theurl.html" class="rolloverStyle">This is the text link.</A></div></td>
</tr>
</table>
</body>
</html>
Reply With Quote

  #2 (permalink)  
Old 01-12-2006, 06:05 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
got this from another forum

This has what I needed to do the trick:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function setStyle(where,theclass){
document.getElementById(where).className=theclass;
}
</script>
<style type="text/css">
<!--
.rolloverStyle a {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 14px; color: #2a57a5; text-decoration: none;}
.rolloverStyleHover a {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 14px; color: #2a57a5; text-decoration: underline;}
-->
</style>
</head>
<body>
<table>
<tr>
<td><A href="theurl.html" onMouseOver="setStyle('testLink','rolloverStyleHov er')" onMouseOut="setStyle('testLink','rolloverStyle')"> <IMG src="imagename.gif" border="1" name="testIcon" alt=""></A></td>
<td><div id="testLink" class="rolloverStyle"><A href="theurl.html">This is the text link.</A></div></td>
</tr>
</table>
</body>
</html>

Thanks to _Aerospace_Eng_
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image rotation script Bryan G Programming and Scripting 9 12-21-2005 05:33 PM
HTML Image question GreenKoopaKid Programming and Scripting 2 12-16-2005 07:43 PM
Controlling image sizes using onmouseover unitygizmo Programming and Scripting 26 09-12-2005 07:04 PM
image map on a rollover? dismante Programming and Scripting 0 05-03-2005 03:02 PM
Image rollover help Ronna Programming and Scripting 2 01-23-2005 12:06 AM


All times are GMT -5. The time now is 04:32 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter