By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,380 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,380 IT Pros & Developers. It's quick & easy.

dynamic mouse over action

P: 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.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 03.7.15 5:35 PM, simon taylor wrote:
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 ?


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
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.