irrumate Posted February 15, 2006 Share Posted February 15, 2006 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 More sharing options...
real_illusions Posted February 15, 2006 Share Posted February 15, 2006 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 More sharing options...
scott100 Posted February 15, 2006 Share Posted February 15, 2006 was wondering if it was possible to create a mouseover script that would change the text of a link<{POST_SNAPBACK}> 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 More sharing options...
mpoer Posted February 16, 2006 Share Posted February 16, 2006 handy dandy javascript info, Scott I've finally learned a javascript thing. Link to comment Share on other sites More sharing options...
scott100 Posted February 16, 2006 Share Posted February 16, 2006 handy dandy javascript info, Scott I've finally learned a javascript thing.<{POST_SNAPBACK}> Glad to hear it, this could be your JavaScript tip of the day Link to comment Share on other sites More sharing options...
irrumate Posted February 16, 2006 Author Share Posted February 16, 2006 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> <{POST_SNAPBACK}> Thanks alot scott Link to comment Share on other sites More sharing options...
mpoer Posted February 16, 2006 Share Posted February 16, 2006 Glad to hear it, this could be your JavaScript tip of the day <{POST_SNAPBACK}> actually, I forgot to credit you, but that's where the idea came from Link to comment Share on other sites More sharing options...
irrumate Posted February 17, 2006 Author Share Posted February 17, 2006 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> <{POST_SNAPBACK}> 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 More sharing options...
scott100 Posted February 17, 2006 Share Posted February 17, 2006 (edited) 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 February 17, 2006 by scott100 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now