[SOLVED] possible to manipulate onmouseout behavior?

This is a discussion on "[SOLVED] possible to manipulate onmouseout behavior?" within the JavaScript Forum section. This forum, and the thread "[SOLVED] possible to manipulate onmouseout behavior? are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Nov 28th, 2007, 18:18
Junior Member
Join Date: Mar 2007
Location: Long Island, NY
Age: 23
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] possible to manipulate onmouseout behavior?

Hi everyone!

I've got a page where visitors cast votes written mostly in php with html (tables, and a little css). There are two choices the visitor can vote for, and as a little effect, i thought it would be nice if when the visitor moused over their choice, the td background would change from a light blue, to a light green. furthermore, when the visitor clicked on their choice i wanted the td background to change from a light green (cause they placed the mouse over their selection) to an even lighter green.

i can get all of that to happen with this code inside of the td tag:
Code: Select all
onmouseover="this.style.background='url(img/lightgreen.gif)'"
onmouseout="this.style.background='url(img/lightblue.gif)'"
onmousedown="this.style.background='url(img/lightergreen.gif)'"
what i cant get to happen is when the visitor clicks on their choice, because of the onmouseout the color goes back to the light blue.

is there any way that when the user clicks down on their choice, the background of the td stays that lighter green? ive got a very limited knowledge of javascript, and ive been having some trouble trying to explain the effect im looking for to google's search engine.

many thanks in advance!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 29th, 2007, 12:15
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: possible to manipulate onmouseout behavior?

If they are selecting their choice, you can do a check as to whether the button is selected..

eg.

Code: Select all
onmouseout="this.checked ? return : this.style.background='url(img/lightergreen.gif)'"
That will see whether the button has been clicked or not and won't change when the mouse is taken away
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 3rd, 2007, 20:45
Junior Member
Join Date: Mar 2007
Location: Long Island, NY
Age: 23
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Re: possible to manipulate onmouseout behavior?

thanks a lott!!!!

when i figured out how to work this into my code it worked like magic. many, MANY, thanks in helping me out.


this forumz great!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
unordered list - strange behavior pesho318i Web Page Design 9 Dec 6th, 2007 14:19
Strange form submit behavior in IE Donny Bahama PHP Forum 3 Apr 27th, 2007 19:36
onMouseOut happening also between cells clintxp JavaScript Forum 3 Mar 28th, 2007 14:30
Poor behavior for simple script in IE7 masonbarge JavaScript Forum 4 Feb 5th, 2007 16:19
Weird Opacity behavior in PS 7 autumn_whispers2me Graphics and 3D 0 May 3rd, 2005 22:24


All times are GMT. The time now is 01:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42