Connecting Tech Pros Worldwide Help | Site Map

dynamic mouse over action

  #1  
Old July 20th, 2005, 10:08 AM
simon taylor
Guest
 
Posts: n/a
Hello and thanks for reading my posting.
My question is ......
Is it possible to change the mouseover action ? so if we have an image
thus

<IMG id="splot" onmouseover= "window.status ='forward'; return false;"
Title=forward onmouseout ="window.status=''; return false;"
src="Images/Navigate.gif" >

and I have a javascript function ...........

<script language=javascript>
function DoIT(){
alert(document.getElementById("splot").title);
document.getElementById("splot").title = "back";
return false;
}
</script>

I can change the title to say "back" but how do I change the mouseover
action to change the status text to say back ?

The more I think about this the more I think this is a little nasty
but if someone has any insight I'd love to hear it !
once again many thanks
simon.
  #2  
Old July 20th, 2005, 10:08 AM
Philip Ronan
Guest
 
Posts: n/a

re: dynamic mouse over action


On 03.7.15 5:35 PM, simon taylor wrote:
[color=blue]
> Is it possible to change the mouseover action ? so if we have an image
> thus
>
> <IMG id="splot" onmouseover= "window.status ='forward'; return false;"
> Title=forward onmouseout ="window.status=''; return false;"
> src="Images/Navigate.gif" >
>
> and I have a javascript function ...........
>
> <script language=javascript>
> function DoIT(){
> alert(document.getElementById("splot").title);
> document.getElementById("splot").title = "back";
> return false;
> }
> </script>
>
> I can change the title to say "back" but how do I change the mouseover
> action to change the status text to say back ?[/color]

You could use a global variable like this:

<script language=javascript>
var statustext = "forward";
^^^^^^^^^^^^^^^^^^^^^^^^^^^
function DoIT(){
alert(document.getElementById("splot").title);
document.getElementById("splot").title = "back";
statustext = "back";
^^^^^^^^^^^^^^^^^^^^
return false;
}
</script>

And then use this variable in the mouseover script:

<IMG id="splot" onmouseover= "window.status = statustext; return false;"

I assume you'll have to change the status text value back again somewhere.

Phil

--
Philip Ronan
phil.ronanzzz@virgin.net
(Please remove the "z"s if replying by email)


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
small application in java.script Marek Staniewski answers 2 June 27th, 2008 08:13 PM
selected items to be displayed in the next page/form ravisuguna answers 2 January 12th, 2008 12:37 PM
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help gunimpi answers 0 January 10th, 2007 08:55 PM
problems with dynamic forms brian.newman@wpafb.af.mil answers 11 July 23rd, 2005 05:49 PM