Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Web Programming and Design
»
Javascript mousetest
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Javascript mousetest (Read 2673 times)
0 Members and 1 Guest are viewing this topic.
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Javascript mousetest
«
on:
April 01, 2012, 02:47:44 pm »
Well, I got this problem with javascript, I have to test if the mouse is over a element, but it must be in a if-condition.
Somehow this doesn't work: if (!document.getElementById('buttons').onmouseover)
Please help me!
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
Deep Toaster
So much to do, so much time, so little motivation
Administrator
LV13
Extreme Addict (Next: 9001)
Posts: 8217
Rating: +758/-15
Re: Javascript mousetest
«
Reply #1 on:
April 01, 2012, 02:50:03 pm »
if (!document.getElementById('buttons').onmouseover)
tests if the
onmouseover
property of #buttons is defined, not whether it's triggered or not. Basically, it tests if the browser is
going
to do something when the user mouses over.
«
Last Edit: April 01, 2012, 02:50:29 pm by Deep Thought
»
Logged
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Javascript mousetest
«
Reply #2 on:
April 01, 2012, 03:52:51 pm »
Ah, I get that. How do I do then what I really want?
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
Eeems
Mr. Dictator
Administrator
LV13
Extreme Addict (Next: 9001)
Posts: 6267
Rating: +318/-36
little oof
Re: Javascript mousetest
«
Reply #3 on:
April 01, 2012, 06:27:10 pm »
You could have onmouseover set a variable and onmouseout unset it.
Kind of like what was suggested here:
http://www.sitepoint.com/forums/showthread.php?572033-Determine-if-mouse-is-over-an-element
I'll look around and see if there is a simpler way.
If you want to do a lot of tests I'm sure there is a way you can use this:
http://www.permadi.com/tutorial/cssGetElementUnderMouse/index.html
«
Last Edit: April 01, 2012, 06:29:01 pm by Eeems
»
Logged
/e
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Web Programming and Design
»
Javascript mousetest