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



Closed Thread
Onmouseover div swap gives flickering effect
Old 01-18-2008, 03:28 PM Onmouseover div swap gives flickering effect
Junior Talker

Posts: 2
Trades: 0
I want to replace a div onmouseover by another div. The replacement takes place, but the div is flickering onmouseover. Why is that and how should I change my source code?

The jscript:
Code:
 
<script type="text/javascript" language="JavaScript"><!--
function HideDIV(d) { document.getElementById(d).style.display = "none"; }
function DisplayDIV(d) { document.getElementById(d).style.display = "block"; }
//--></script>
The divs:
Code:
 
<div class="menuiteminactief" id="contactout" onmouseover="HideDIV('contactout');DisplayDIV('contact')"><a href="contact.html" class="menu1">Contact</a></div>
<div class="menuitemactief" id="contact" style="display:none;" onmouseout="HideDIV('contact');DisplayDIV('contactout')">
<a href="contact.html" class="menu1" onmouseover="changeBg('contact','2')" onmouseout="changeBg('contact','1')">Contact</a><br>
<a href="contact.html" class="menu2" onmouseover="changeBg('contact','3')" onmouseout="changeBg('contact','1')">Verslagen</a><br>
<a href="contact.html" class="menu2" onmouseover="changeBg('contact','4')" onmouseout="changeBg('contact','1')">Lid worden</a><br>
<a href="contact.html" class="menu2" onmouseover="changeBg('contact','5')" onmouseout="changeBg('contact','1')">Andere vraag</a>
</div>
The complete code:
http://www.zuidamerika.net/ftcw2008/index_menutest.html
JanDeGroot is offline
View Public Profile
 
 
Register now for full access!
Old 01-18-2008, 04:18 PM Re: Onmouseover div swap gives flickering effect
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
change class names instead of backgrounds.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
View Public Profile Visit chrishirst's homepage!
 
Old 01-19-2008, 04:33 PM Re: Onmouseover div swap gives flickering effect
Junior Talker

Posts: 2
Trades: 0
I'm sorry, does'nt work. I removed the 'change-background' script but the flickering effect is still there.

Code:
 
<a href="contact.html" class="menu1">Contact</a><br>
<a href="contact.html" class="menu2">Verslagen</a><br>
<a href="contact.html" class="menu2">Lid worden</a><br>
<a href="contact.html" class="menu2">Andere vraag</a>
The complete code:
http://www.zuidamerika.net/ftcw2008/index_menutest.html
JanDeGroot is offline
View Public Profile
 
Old 01-19-2008, 10:22 PM Re: Onmouseover div swap gives flickering effect
svirid's Avatar
Experienced Talker

Posts: 34
Name: Dima
Location: Toronto, Canada
Trades: 0
I am a little confused here what are u trying to do but I think the problem is with your 'A' DOM elements inside the DIV.
What hapends is that u have mouseout event on your DIV and when u mouse over on A element mouseout fires on DIV even that A tag located inside the DIV.

The easies way what u can do is to define event for the A tag on mouseover and cacel all of the following events.

set <a mosuseover="test(event)">Contact</a>

test = function(event) {
if(event.preventDefault)
event.preventDefault();
else
event.returnValue = false;
}
svirid is offline
View Public Profile Visit svirid's homepage!
 
Closed Thread     « Reply to Onmouseover div swap gives flickering effect
 

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.66643 seconds with 12 queries