Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-31-2010, 06:19 PM   PM User | #1
sethwb
Regular Coder

 
Join Date: Aug 2008
Posts: 105
Thanks: 9
Thanked 0 Times in 0 Posts
sethwb is an unknown quantity at this point
$('#homefeature').mouseleave(function() { literally does not work?

I've had this problem with other sites as well since I started using jQuery a year ago - the function simply does not work as expected.

I have also tried the jQuery mouseout as a substitute and it literally does not do anything, not even an alert will fire when I wave my mouse in any manner, frantically or otherwise over the specified element, which have always been div's with an ID.

Is there some trick to getting this to work or what the heck am I doing wrong!? Here is the function in its entirety:

$('#homefeature').mouseleave(function() {
document.getElementById('homefeaturepics').style.display = "";
document.getElementById('homefeaturecontent').style.display = "none";
});

or

$('#homefeature').mouseout(function() {
document.getElementById('homefeaturepics').style.display = "";
document.getElementById('homefeaturecontent').style.display = "none";
});

If there are no obvious problems or workarounds to this situation that people know if I'll pull the code together for you to look at. I really appreciate any advice or ideas.

Thanks!
sethwb is offline   Reply With Quote
Old 08-31-2010, 06:25 PM   PM User | #2
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,765
Thanks: 8
Thanked 123 Times in 121 Posts
harbingerOTV will become famous soon enough
Code:
$('#homefeature').mouseleave(function() {
	$('#homefeaturepics, #homefeaturecontent').css({'display' : 'none'});
});
try that?
__________________
Stop making things so hard on yourself.
i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis
harbingerOTV is offline   Reply With Quote
Old 08-31-2010, 07:03 PM   PM User | #3
sethwb
Regular Coder

 
Join Date: Aug 2008
Posts: 105
Thanks: 9
Thanked 0 Times in 0 Posts
sethwb is an unknown quantity at this point
I've tried that. I've also tried a basic alert('hi'); and that doesn't work either.
sethwb is offline   Reply With Quote
Old 08-31-2010, 07:08 PM   PM User | #4
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,765
Thanks: 8
Thanked 123 Times in 121 Posts
harbingerOTV will become famous soon enough
so this:
Code:
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() { 	
$('#homefeature').mouseout(function() {
     alert("yo!");
});
});
</script>
<div id="homefeature" style="height: 100px; background: #9de; margin: 0 0 10px 0;">home feature</div>
doesn't even work for you?

Maybe show the whole code?
__________________
Stop making things so hard on yourself.
i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis
harbingerOTV is offline   Reply With Quote
Old 08-31-2010, 07:15 PM   PM User | #5
sethwb
Regular Coder

 
Join Date: Aug 2008
Posts: 105
Thanks: 9
Thanked 0 Times in 0 Posts
sethwb is an unknown quantity at this point
That is correct. It's going to take me a minute to get it together the server is down
sethwb is offline   Reply With Quote
Old 09-01-2010, 08:33 PM   PM User | #6
sethwb
Regular Coder

 
Join Date: Aug 2008
Posts: 105
Thanks: 9
Thanked 0 Times in 0 Posts
sethwb is an unknown quantity at this point
Thank you for your help. Although you probably didn't realize it you helped me by putting it inside a $(document).ready function. That took care of it not firing, however it is still pretty buggy.

Basically whenever You hover over one of 5 navigation images it's content slides out below the nav. I tried setting the mouseleave function for a containing div that holds both the nav, and the content for each one.

My problem now is that whenever you leave the containing div, it does not always hide the individual nav content as expected, only some of the time. The faster I move my mouse off, the less likely it is to work. I have a hunch its something to do with the div resizing as the nav content appears, but I'm not 100% sure yet.
sethwb is offline   Reply With Quote
Old 09-01-2010, 09:04 PM   PM User | #7
sethwb
Regular Coder

 
Join Date: Aug 2008
Posts: 105
Thanks: 9
Thanked 0 Times in 0 Posts
sethwb is an unknown quantity at this point
I guess my next question for you is where can I find an event bubbling tutorial/bible?

I need to get this drop down content to work nicely, but right now the mouseleave is acting very rude. I think I'm going to take a look around and if I don't find anything I'll post this question in a new topic.
sethwb is offline   Reply With Quote
Reply

Bookmarks

Tags
fire, mouseleave, mouseout, trigger, work

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 12:10 AM.


Advertisement
Log in to turn off these ads.