prc Posted April 27, 2006 Share Posted April 27, 2006 I'm trying to make a function from the mouse over script to display messages in the status bar. I got it working with the following script: <a href="#" onmouseover="window.status='Home';return true;" onmouseout="window.status='';return true;">Home</a> but now that I have a few of these for my navigation I was wondering if this could be done by calling it by a function. Is this possible in this case? Here is my code at the moment: <html> <head> <script type="text/javascript"> function roll(txt) {window.status=''+txt+'';return true;}</script> </head> <body> <a href="#" onmouseover="roll('Home')" onmouseout="roll('')">Home</a></body> </html> any help would be greatly appreciated. prc Link to comment Share on other sites More sharing options...
scott100 Posted April 27, 2006 Share Posted April 27, 2006 Here's one i made earlier <html><head><script>function showStatus(sMsg){ window.status = sMsg; return true ;}</script></head><body><a href="http://www.google.com" onMouseOver="return showStatus('Hi Google');" onMouseOut="return showStatus('');">Google</a><br /><a href="http://www.yahoo.com" onMouseOver="return showStatus('Hi Yahoo');" onMouseOut="return showStatus('');">Yahoo</a><br /><a href="http://www.ebay.com" onMouseOver="return showStatus('Hi Ebay');" onMouseOut="return showStatus('');">Ebay</a></body></html> Link to comment Share on other sites More sharing options...
Chocolate570 Posted April 27, 2006 Share Posted April 27, 2006 Some browsers don't support window.status, and in FireFox, you have to enable it as an option in the settings section. But this should work in IE: <html><head><script type="text/javascript">function roll(txt){window.status=txt;}</script></head><body><a href="#" onmouseover="roll('Home')" onmouseout="roll('')">Home</a></body></html> Link to comment Share on other sites More sharing options...
pulpfiction Posted April 27, 2006 Share Posted April 27, 2006 Scott's code is working but not chocolate's. propably it needs the "return" from the function Link to comment Share on other sites More sharing options...
prc Posted April 28, 2006 Author Share Posted April 28, 2006 yer chocolates one was like what I had, but I needed just to know the next step. thanks guys. 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