Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

OnMouseOver event

Posted on 1998-06-21
7
Medium Priority
?
477 Views
Last Modified: 2011-09-20
Please could someone tell me why this generates an error?
It seems to work (nearly!)

<font onMouseOver="this.style.font='bold' " onMouseOut="this.style.font='normal'">
<p>Text to change </font></p>

Ta.
0
Comment
Question by:phooey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:dima_sherman
ID: 1844315
Hi, goto http://hey.to/hillz and read the source of the page.
0
 
LVL 2

Author Comment

by:phooey
ID: 1844316
This does not really answer my question.  I am already familiar with changing colour, text etc onMouseOver but I want to make the text bold?
0
 
LVL 8

Expert Comment

by:MaDdUCK
ID: 1844317
did you include a "... return true" statement in the JavaScript line?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:martinag
ID: 1844318
I think it is impossible to do what you want to do.
The font colors are changeable because they are set with <FONT></FONT>
But bold is a special tag (<B></B>) and normal hasn't got any tag at all.
0
 

Expert Comment

by:Spo0n
ID: 1844319
This doesn't solve it but it's as close as I could get..so it's not really an answer i spose...

<script language=JavaScript>

function goBold(textIn) {
textaOn = textIn.bold();
document.write(textaOn);
}

function goNormal(textIn) {
textaOff = textIn;
document.write(textaOff);
}

</script>
<body>
<font onMouseover="goBold('hurro'); return true;" onMouseout="goNormal('indeed'); return true;">indeedily</font>
</body>

It works....but wont change back with onMouseout...it seems to kill the page and wont reload...you have to reopen the file.
I tried heaps of things like using ' this ' as input with different results.....none of which worked.  It's really just an image flipping function but the text is making it go a little err 'wobbly'.  :)   Good luck.
0
 
LVL 2

Author Comment

by:phooey
ID: 1844320
Sorry guys, worked it out myself.  For interest:
Set up two styles, one for onMouseOver and one for onMouseOut.  In the style you can set the font colour and weight and anything else you care to mention.

(Free 10 points to anyone who answers this, just to get it off the list)
Dave.
0
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 150 total points
ID: 1844321
DId you set these style up with a style sheet? You could do the font weight thingy right in the tag because unlike bold, font weight is controlled via the font tag (or more like through the style tag)

Do you want this for links or for normal text. If you do it for links, then I guess it is best to define the styles a.link and a.hover because then this will happen automatically.

Good luck!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question