answersLogoWhite

0


Best Answer

Yes. Set the element's display property to "none" (style="display:none;").
Now add the event handler onmouseover and make it enable the display:
onmouseover="this.style.display='block'"
To hide the element when the mouse moves away, add
onmouseout="this.style.display='none'".

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you use a Javascript event to hide an element but not if the mouse is moved over that element?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is event handling in java script?

Event handling is when an action from the user triggers a JavaScript function. An event handler is defined as the following:Click me!This will open an alert box with the message You clicked me! displayed in it when the user clicks the div element.There are many event handlers in JavaScript. Some common ones include:onclick (triggered when user clicks the element)onload (triggered when page, image, etc. loads)onfocus (triggered when element gains focus (becomes active))onblur (triggered when element loses focus)onmouseover (triggered when user's mouse pointer enters the element)onmouseout (triggered when user's mouse pointer leaves the element)onmousemove (triggered when user's mouse pointer is moved while it is on top of the element)onkeydown (triggered when user presses a key on the keyboard)onkeyup (triggered when user releases a key on the keyboard)onkeypress (triggered when user presses, then releases a key on the keyboard)I would recommend you look some of these up and find out more.Event handlers can be applied as HTML attributes as shown above, or they can be applied during JavaScript execution, as shown below.In Netscape-based browsers (Firefox, Google Chrome, etc.):var myHTMLElement=document.getElementById("myElement");myHTMLElement.onclick="You clicked me!"Or:var myHTMLElement=document.getElementById("myElement");myHTMLElement.addEventListener("click",function (){alert("You clicked me!");});Note that when using addEventListener, remove the "on" from the event name to get the first parameter. For example, "onload" becomes "load". Also, you can remove this event handler with removeEventListener using the same parameters as addEventListener.In Internet Explorer (prior to version 9):var myHTMLElement=document.getElementById("myElement");myHTMLElement.attachEvent("onclick",function (){alert("You clicked me!");});In Internet Explorer 9, you can use the method you used for Netscape-based browsers. Also, you can remove this event handler with detachEvent using the same parameters as attachEvent.I would encourage you to find out more about event handlers by searching Google.


How does a computers mouse know you have moved it?

you have to move the mouse


What are the Onmouseover events about?

An 'onmouseover' event refers to an event that happens on a computer when the mouse is moved over a particular area on the screen. A particular part of the screen is programmed to react when the mouse is within its' boundaries, there can be multiple areas on one screen. This function enables various interactions with the screen.


What does the mouse pointer change into when it is moved into a document?

a Croatia's shape


What examples of element of supernatural in Monkey's Paw?

the element of supernatural in the monkey's paw is when the piano moved


What event moved the earth off its axis?

when the mars sized object slammed into the early earth and moved its axis and formed our moon.


Why is a mouse called an input devices?

A mouse is considered a input device because it is moved by the human/robot user, inputting the signal on where the cursor should go and what actions the cursor does. A mouse is an input device because it allows you to input and send data to the computer.


What is initially transparent disappears if not used but is bright in appearance when the mouse is moved over it in PowerPoint?

the Mini toolbar


Highlighting an area of text with your mouse so it can be edited formatted copied or moved is called?

dragging


What is the 3rd element in Zelda the minish camp?

Water but first you have to go through caster wilds to find out the wind element has been moved.


What big event happened to the Frankstein family when Victor was seven?

The Frankensteins moved and had a son.


How do computers sense where to move the pointer when the mouse is moved?

The mouse has sensors inside to know which way you moved it. The way this works depends on the type of mouse. In the more traditional optical-mechanical mice, the wheel turns rollers on two axes. Those rollers have slitted wheels, and light shines through the slits to photocells on the other side. Then the photocells send the signal to the mouse's board and then to the computer. From there, the mouse driver converts the signals into cursor movement. In optical mice, there is a laser LED and a digital camera chip. The mouse acts like a video camera, and the circuitry on the mouse's board detects the direction and amount of movement and sends it to the computer. The signals are pretty much the same as with the other type of mouse.