views:

29

answers:

2

Creating a website using simple html(not html5) and css but got stock in mouseover effect. Need to show some text with background image when user mouseover a link. Following is an example..

NORMAL: On mouse Out

OVER: alt text

I don't think it is possible to create the effect with simple CSS. My question is what is the most effective way to create the over effect and how? Javascript, DHTML or other language...

Thanks in advance...Rex...

A: 

You can use javascript to show a hidden div which is having text written inside it.

use javascript's onmouseover and onmouseout events to do this.

However have you tried using href:hover property of css to achieve this?

sushil bharwani
Hi Sushil thank for the quick response... I am ActionScript programmer and don't know much about Javascript and just learning CSS. I know I can add image/change bg image but don't know about the text.... I am leaning towards javascript as the functions are modular ... as I am pretty new to it... any good tutorial recommendations...Thanks,Rex
rex
see if this article helps u increase your knowledge http://www.alistapart.com/articles/hybrid/
sushil bharwani
+3  A: 

Rex,

I think you would find jQuery very useful. jQuery is a javascript framework, very easy to use. www.jquery.com

You can achieve your effect with pure javascript, but again I think you will find using a javascript framework much easier, since your coming from actionscript.

For your particular instance I would make a div absolutely positioned. To show the div on mouseover you can use the jQuery $("#div_id").show(); and on mouseout use .hide();

Here is a basic tutorial for using show hide on events with jQuery.

http://www.learningjquery.com/2006/09/slicker-show-and-hide

Good luck!

jhanifen
Yeah, agree with this one. JQuery Rocks
Raymund
Thank for the reply, I was about to ask about the javasciprt/ jquery... at quick glance the tutorial looks like what I am looking.. and little bit extra.. which is awesome... Let's see how it goes...Thanks,Rex
rex