Jump to content

Wondering if this is possible


irrumate

Recommended Posts

I am sort of new to php and css, but have some background in HTML/XHTML/DHTML and was wondering if it was possible to create a mouseover script that would change the text of a link, i.e.:if the original text for the link is:Mouseover Linkcould I create a script to make it say:[Mouseover Link](with the brackets around it)please help me find out if this is possible. Thank you very much.

Link to comment
Share on other sites

you can change the colours and underlines of links using css

A:link {text-decoration:none; color:#FF0000}A:visited {text-decoration:none; color:#FF0000}A:hover { color:#FF9900; text-decoration:underline;}A:active {text-decoration:none; color:#FF9900}

means - all links when not used or have the mouseover are red, but when mouse is over, are green and underlines and clicked are just green.if you want to use the mouseover attribute, thats javascript.do a search on google for javascript rollovers and you'll get a quite a few results.its best to see if you can find a solution, if you can, then pick one, then if you cant understand, we'll help you with it.

Link to comment
Share on other sites

was wondering if it was possible to create a mouseover script that would change the text of a link

Yes it is possible to change text written on a page, use innerHTML, this should do what you asked for:
<a href="http://www.google.com" style="text-decoration:none" onmouseover="this.innerHTML='[Mouseover Link]'" onmouseout="this.innerHTML='Mouseover Link'">Mouseover Link</a>

:)

Link to comment
Share on other sites

Yes it is possible to change text written on a page, use innerHTML, this should do what you asked for:
<a href="http://www.google.com" style="text-decoration:none" onmouseover="this.innerHTML='[Mouseover Link]'" onmouseout="this.innerHTML='Mouseover Link'">Mouseover Link</a>

:)

One more question. The code you have written for me works fine, but I was wondering how I could write it to put it in my external CSS. Please help if you can. Thank you.
Link to comment
Share on other sites

mmm, dont think its possible, try an external javascript.To elaborate a bit moreVisit this page on External JavaScripts: http://www.w3schools.com/js/js_whereto.aspPut exactly this code into the external JavaScript file you create

document.write('<a href="http://www.google.com" style="text-decoration:none" onmouseover="this.innerHTML=\'[Mouseover Link]\'" onmouseout="this.innerHTML=\'Mouseover Link\'">Mouseover Link</a>')

Edited by scott100
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...