473,543 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to do rollover with dynamic text?

I have this code that I want to use to do a rollover. However, because the
company I am doing it for is continually changing the text, I want to be
able to use dynamic text to change the text on the fly, and still have the
rollover work. I have taken the text off of the buttons, but cannot figure
out how to do it with dynamic text using javascript and html.

For example, in the columns of this row, I want to put "About
Us","Warranty", "Insurance","Sp ecials","Tools" , and "Tips" respectively. I
can change the primary image to be the background of the cell, but then how
do I change the image for the rollover? If I leave the rollover as it is,
how do I place the dynamic text over the image? Is there a way in
Javascript to write on the canvas of the image? I have no idea, and any
help would greatly be appreciated! Thanks!

<TR>
<TD COLSPAN=5>
<a href="about.htm l" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_01','','image s/home_01_over.jp g',1)"><img
src="images/Home_01.jpg" alt="ABOUT US" name="Home_01" width="90"
height="30" border="0"></a>
</TD>
<TD COLSPAN=3>
<a href="warranty. html" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_02','','image s/home_02_over.jp g',1)"><img
src="images/Home_02.jpg" alt="WARRANTY" name="Home_02" width="90"
height="30" border="0"></a>
</TD>
<TD COLSPAN=4>
<a href="#" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_03','','image s/home_03_over.jp g',1)"><img
src="images/Home_03.jpg" alt="INSURANCE" name="Home_03" width="90"
height="30" border="0"></a>
</TD>
<TD COLSPAN=3>
<a href="#" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_04','','image s/home_04_over.jp g',1)"><img
src="images/Home_04.jpg" alt="THE A-TEAM" name="Home_04" width="90"
height="30" border="0"></a>
</TD>
<TD COLSPAN=4>
<a href="#" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_05','','image s/home_05_over.jp g',1)"><img
src="images/Home_05.jpg" alt="BUYER TOOLS" name="Home_05" width="90"
height="30" border="0"></a>
</TD>
<TD COLSPAN=4>
<a href="#" onMouseOut="MM_ swapImgRestore( )"
onMouseOver="MM _swapImage('Hom e_06','','image s/home_06_over.jp g',1)"><img
src="images/Home_06.jpg" alt="BUYING TIPS" name="Home_06" width="90"
height="30" border="0"></a>
</TD>
Sep 23 '05 #1
3 2698
I would recommend taking off the text from the images, and rendering
them all as css rollovers.

I recently did this at http://www.pavauk.org.uk//local/local.php (the
menu at the bottom of the page is database driven).

If you need further help with this let me know.

Cheers

Ian

www.boan-design.co.uk

Sep 23 '05 #2
JOSEPHINE ALVAREZ wrote:
I have this code that I want to use to do a rollover. However, because the
company I am doing it for is continually changing the text, I want to be
able to use dynamic text to change the text on the fly, and still have the
rollover work. I have taken the text off of the buttons, but cannot figure
out how to do it with dynamic text using javascript and html.

For example, in the columns of this row, I want to put "About
Us","Warranty", "Insurance","Sp ecials","Tools" , and "Tips" respectively. I
can change the primary image to be the background of the cell, but then how
do I change the image for the rollover? If I leave the rollover as it is,
how do I place the dynamic text over the image? Is there a way in
Javascript to write on the canvas of the image? I have no idea, and any
help would greatly be appreciated! Thanks!

Don't use JavaScript at all (especially that dreadful old MM_ stuff),
use CSS.

See if this does the job:

<html><head><ti tle>Link play</title>
<style type="text/css">

A:link {
text-decoration: none;
text-align: center;
line-height: 2em;
display: block;
width: 90px;
height: 30px;
border: 2px solid green;
background-image: url('images/home_01.jpg');
}

A:visited {
text-decoration: none
}

A:active {
text-decoration: none
}

A:hover {
text-decoration: underline;
color: red;
background-image: url('images/home_01_over.jp g');
}

</style>
</head>
<body>

<a href="#">Link text</a>

</body></html>
If you need any help with the CSS, post in
comp.infosystem s.www.authoring.stylesheets

[...]
--
Rob
Sep 23 '05 #3
I agree, but look into a css rollover that changes position, (and put
both over and out images into one), this way you will require no image
preloading.

Cheers

Ian

www.boan-design.co.uk

Sep 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2952
by: NONYA | last post by:
Is it possible for me to to the following: 1. I want to limit the amount of pix on my site as much as possbile. 2. I want to create menu with text links such as: about us, contact, etc.... 3. I want it so that when someone rolls over "about us" that another line of text appears below it that says: "Who we are." I can do this with images...
5
5172
by: jedbob | last post by:
I used Adobe Imageready to build a simple rollover navigation bar, where the text will change color on a mouse over. The working example can be found at: http://www.akujunkan.com/test/NavBar.html However, when I try to incorporate the javascript and code into another table, the rollover stops working:...
6
3177
by: AJBopp | last post by:
I'm wrestling with CSS variations between Firefox and IE. I'm trying to create rollover buttons in a menu frame. It is working perfectly in Firefox but in IE only the first button is properly highlighted and linked. The second button, has only a partial "hit area" at the top of the image, although if you click the link, you can see the link...
2
1143
by: Doug | last post by:
Using ASP.NET, is this possible? All I want is something simple, like bold-facing the text. An alternative would be to use plain text links (IE 6.0, so we can rely on CSS and the anchor hover). Maybe there's a 3rd party control out there that does this? Possible to make your own? Thoughts? Thanks.
2
2922
by: mix2plix | last post by:
ok.. been bangin by brains the past few days with this one and decided to seek you'z help. so here ya go. based on the code below and this concept.. how should i proceed? I have a table of 4 equal squares in which i've placed 4 equal sized pictures. now i'd like to create a link on the 4 pictures and have them change pictures when the...
0
4465
daJunkCollector
by: daJunkCollector | last post by:
I wrote the following script. I have a movieclip named countyA_mc. I want the user to mouse over this movie clip, and result in the sending of a variable to the middle tier. I can establish communication when I use a .click event listener on a button component, but when I attempt to convert the script (in the following logical way) I do not...
2
3037
by: eholz1 | last post by:
Hello CSS and StyleSheet members, I have decided to move away from Dreamweaver javascript rollover buttons, in favor of a CSS type rollover button. (hope that is ok). I plan to use PHP to include the page with the rollover buttons as a php include in a div for navigation buttons (left side of web page). I have cobbled together some...
1
2277
by: Jim in Arizona | last post by:
using ASP.NET/VB.NET 2.0 I can change the text color of an ASP Button object on mouse rollover/rollout by doing this (in page_load) btnMyButton.Attributes.Add("onmouseover", "this.style.color='Yellow'") btnMyButton.Attributes.Add("onmouseout", "this.style.color='White'") But how can I change the text on rollover? I don't understand the...
0
7733
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7344
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3388
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1814
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
633
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.