4 Replies - 6319 Views - Last Post: 05 July 2011 - 11:24 PM

#1 animedude123   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 03-August 07

OnMouseOut/Over Problems

Posted 07 June 2009 - 04:43 PM

Hey,

I currently have this (Using jQuery):

<div>
	<div class="imgNav" id="info1" onmouseout='$("#info1").hide(); $("#img1").show();'>
		<p>Stuff</p>
		<p><a href="#">Enlarge</a></p>
	</div>
	<span id="img1" onmouseover='$("#info1").fadeIn(); $("#img1").hide();'><img src="images/thumbs/image.png" /></span>
</div>



My problem is that when I hover over info1 and one of its sub elements (p or a), it activates the onmouseout effect. Only though when I cross that invisable box line that surrounds them.

So the effect is this constant mouseover/mouseout effect when I hover over the sub elements (Once I hover over the sub elements, img1 shows, but then I mouseover that so info1 starts to show).

Anyone know how to fix this?

Thanks in advance for any help!

Is This A Good Question/Topic? 0
  • +

Replies To: OnMouseOut/Over Problems

#2 BetaWar   User is offline

  • #include "soul.h"
  • member icon

Reputation: 1695
  • View blog
  • Posts: 8,592
  • Joined: 07-September 06

Re: OnMouseOut/Over Problems

Posted 07 June 2009 - 04:59 PM

Moved to jQuery.
Was This Post Helpful? 0
  • +
  • -

#3 animedude123   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 03-August 07

Re: OnMouseOut/Over Problems

Posted 07 June 2009 - 05:13 PM

Hmm, ok.

Its not really a jQuery problem though (I just wanted to let people know the effects were used with jQuery).

The real problem is with the generic onmouseover/out and the sub elements (I think so at least).
Was This Post Helpful? 0
  • +
  • -

#4 animedude123   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 03-August 07

Re: OnMouseOut/Over Problems

Posted 07 June 2009 - 07:05 PM

Ok, so I sorta got a fix. It seems to work fine, but I was hoping for a way that didn't require more javascript (I'm already using a lot).

Fix was found here: http://webmaster-for...hread.php?t=854
Was This Post Helpful? 0
  • +
  • -

#5 tabib_m   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-April 09

Re: OnMouseOut/Over Problems

Posted 05 July 2011 - 11:24 PM

View Postanimedude123, on 07 June 2009 - 05:43 PM, said:

Hey,

I currently have this (Using jQuery):

<div>
	<div class="imgNav" id="info1" onmouseout='$("#info1").hide(); $("#img1").show();'>
		<p>Stuff</p>
		<p><a href="#">Enlarge</a></p>
	</div>
	<span id="img1" onmouseover='$("#info1").fadeIn(); $("#img1").hide();'><img src="images/thumbs/image.png" /></span>
</div>



My problem is that when I hover over info1 and one of its sub elements (p or a), it activates the onmouseout effect. Only though when I cross that invisable box line that surrounds them.

So the effect is this constant mouseover/mouseout effect when I hover over the sub elements (Once I hover over the sub elements, img1 shows, but then I mouseover that so info1 starts to show).

Anyone know how to fix this?

Thanks in advance for any help!


Hi,
You can use .mouseleave() method in jQuery: http://api.jquery.com/mouseleave
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1