Welcome visitor
* Login
* Register
It is currently September 20th, 2019, 9:32 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  send color code to a function
PostPosted: June 1st, 2009, 8:04 pm 
User avatar

Posts: 70
hi, how can i send a color code to a javascript function?

this is what im doing. I have many divs on my page and on mouseover they change their colors. So i have a single function that receives the color in a var, then it is supposed to change the color but it dosent.
function sh(lt,n){
    event.srcElement.style.color = '#' + lt;
    }
onmouseover="sh(f00,id);"

thanks.


Top
 Profile  
 
  Re: send color code to a function
PostPosted: June 1st, 2009, 8:11 pm 
User avatar

Posts: 63
onmouseover="sh('f00',id);"

add the quotes, else javascript thinks f00 is a variable.


Top
 Profile  
 
  Re: send color code to a function
PostPosted: June 1st, 2009, 8:37 pm 
User avatar

Posts: 70
thank you :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron