Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to add onmouseover event with javascript
Old 08-09-2009, 07:10 PM How to add onmouseover event with javascript
Experienced Talker

Posts: 45
Trades: 0
Hi

I have this code
Code:
function display(action)
{
if (action == 'show')
{  
//show 
document.getElementById("divname").style.display = "block";
}
if (action == 'hide')
{
 //hide 
document.getElementById("divname").style.display = "none";
}
}

<div id="divname" onmouseover="javascript:display('show')" onmouseout="javascript:display('hide')">
How can I change onmouseover="javascript:display('show')" onmouseout="javascript:display('hide')" with another onmouseover="javascript:display('showanother')" onmouseout="javascript:display('hideanother')"


I tried this with no results

Code:
function display(action)
{
if (action == 'show')
{  
//show 
document.getElementById("divname").style.display = "block";
document.getElementById("divname").onmouseover="javascript:display('showanother')";

// so divname will make something on first onmouseover and then i want to change with another onmouseover .. in my case onmouseover="javascript:display('showanother')";
  
}
if (action == 'hide')
{
 //hide 
document.getElementById("divname").style.display = "none";
}
}

Hope that make sense ... Thank you in advance
__________________

Please login or register to view this content. Registration is FREE
dan101 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2009, 08:05 PM Re: How to add onmouseover event with javascript
Novice Talker

Posts: 6
Name: Andrea
Trades: 0
Hello,

Can you provide a little more information or perhaps a working example from another website?
__________________

Please login or register to view this content. Registration is FREE
runningpumpkin is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 04:33 AM Re: How to add onmouseover event with javascript
Extreme Talker

Posts: 167
Name: Jilesh
Trades: 0
Hi,

Have a check complete example of MouseHover is here:

http://www.w3schools.com/jsref/jsref_onmouseover.asp

First refer it then implement into your code according to your requirement.
__________________

Please login or register to view this content. Registration is FREE

ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
thewebhostingdi is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 12:20 PM Re: How to add onmouseover event with javascript
Experienced Talker

Posts: 45
Trades: 0
Hi again.

I solved some of the problems.. I have a strange one now. It works in FF3 but in IE6 no

This not works in ie6

Code:
var nr = document.getElementsByClassName("java"); 
for(var i=1; i<=nr.length; i++)
This works
Code:
var nr = 2; 
for(var i=1; i<=nr; i++)
What is the problem because i don't see ..
__________________

Please login or register to view this content. Registration is FREE
dan101 is offline
Reply With Quote
View Public Profile
 
Old 08-11-2009, 08:10 AM Re: How to add onmouseover event with javascript
JEDs's Avatar
Junior Talker

Posts: 2
Name: Steve Warriner
Location: CNY Fingerlakes
Trades: 0
dan101,

I cannot pm yet as this is my 1st post. I was interested in your sig links but they are all "Forbidden" 403 or 4.

Please pm me. Thanks

JEDs
JEDs is offline
Reply With Quote
View Public Profile Visit JEDs's homepage!
 
Reply     « Reply to How to add onmouseover event with javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59711 seconds with 12 queries