473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Changing text on current page when mouseover

Hi,

I'm just wondering how I change some css text when I mouseover a picture. At
the moment document.write just writes to a new page.

function displayname(name)
{
document.write(name);
}

<a href="#" onMouseOver="displayname('Autumn Brown')"
onMouseOut="hidename()"><img src="img/autumnbrown.jpg" width="70"
alt="Autumn Brown" border="0"></a>

Thanks
Jun 6 '06 #1
3 1927
elyob said the following on 6/6/2006 1:52 PM:
Hi,

I'm just wondering how I change some css text when I mouseover a picture. At
the moment document.write just writes to a new page.

function displayname(name)
{
document.write(name);
}

<a href="#" onMouseOver="displayname('Autumn Brown')"
onMouseOut="hidename()"><img src="img/autumnbrown.jpg" width="70"
alt="Autumn Brown" border="0"></a>


Try reading the group FAQ. Specifically the section on DynWrite. It is
titled "How do I modify the current page in a browser?"

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 6 '06 #2

"Randy Webb" <Hi************@aol.com> wrote in message
news:r5******************************@comcast.com. ..
elyob said the following on 6/6/2006 1:52 PM:
Hi,

I'm just wondering how I change some css text when I mouseover a picture.
At the moment document.write just writes to a new page.

function displayname(name)
{
document.write(name);
}

<a href="#" onMouseOver="displayname('Autumn Brown')"
onMouseOut="hidename()"><img src="img/autumnbrown.jpg" width="70"
alt="Autumn Brown" border="0"></a>


Try reading the group FAQ. Specifically the section on DynWrite. It is
titled "How do I modify the current page in a browser?"


Thanks, sorry for being crap....

Just wondering, is it cleaner to use an iframe and update a small area than
refresh the whole page (as your faq suggests).

Thanks
Jun 6 '06 #3
elyob said the following on 6/6/2006 7:44 PM:
"Randy Webb" <Hi************@aol.com> wrote in message
news:r5******************************@comcast.com. ..
elyob said the following on 6/6/2006 1:52 PM:
Hi,

I'm just wondering how I change some css text when I mouseover a picture.
At the moment document.write just writes to a new page.

function displayname(name)
{
document.write(name);
}

<a href="#" onMouseOver="displayname('Autumn Brown')"
onMouseOut="hidename()"><img src="img/autumnbrown.jpg" width="70"
alt="Autumn Brown" border="0"></a>

Try reading the group FAQ. Specifically the section on DynWrite. It is
titled "How do I modify the current page in a browser?"


Thanks, sorry for being crap....

Just wondering, is it cleaner to use an iframe and update a small area than
refresh the whole page (as your faq suggests).


The FAQ doesn't suggest refreshing the entire page. DynWrite modifies
the innerHTML of a container object. You can do that, quite easily,
without refreshing an entire page.

Whether you use an IFrame or the DynWrite method would depend on what
you are wanting to change. For what you want to do, use DynWrite and
change the innerHTML of a div tag.

A better alternative for just the code you posted is the title attribute
of the img tag.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 7 '06 #4

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

Similar topics

4
by: Kenny | last post by:
I have been trying to write a script that will increase the size of and image when you mouse over it, and decrease it to original size, when you mouse out. After a couple of attempts, this is what...
3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
6
by: Carla | last post by:
hi people, I have a little problem that I can't solve with css and i was wondering if you could help me. I have 4 links, I want that when I click/mouseover in the link 1, it turns to a color...
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
6
by: Thaynann | last post by:
I have an app that i am developing, it access a website via HttpWebRequest and HttpWebResponse classes (eg http://thaynann.com/images/) and at the moment i am able to save all the image files from...
6
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
0
by: Sydem | last post by:
I have a classic ASP site that I'm converting to ASP.NET 2.0 using VS 2005 Beta 2 with the VB.NET language. In my classic ASP web app I use a custom Javascript that creates a menu "control". In...
1
by: JB | last post by:
I have a set of links that are currently images that when the person rolls over them, they change color. Essentially the image is a box where the background is brown and the text is blue. When the...
1
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi, I have a repeater control with rows in made of of link buttons so that they react to a click as below: <div> <ASP:Repeater id="rptUserList" runat="server"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.