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

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 04-29-2012, 11:55 PM   PM User | #1
Tjerfer
New to the CF scene

 
Join Date: Apr 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Tjerfer is an unknown quantity at this point
my function only fires once, why?

alright so im a noob to js (so if my jargon isn't quite right I apologize).

I wrote this program:


[CODE]
function drown() {
$('#nav li a').mouseover(
function() {
$('#nav li ul').show();
});
$('#nav li a').mouseout(
function() {
$('#nav li ul a').hide();
});
};
[CODE]

which is for a drop down navigation menu. Its real basic, but its my first program from scratch. the only problem is that it only fires once, meaning when i mouse over the parent li it only "drops down" the child ul and "brings it up" only one time. The subsequent times I mouse over nothing occurs.

I have spent hours reading forums and books but I'm still lost. If you need the html or css documents let me know.
Tjerfer is offline   Reply With Quote
Old 04-30-2012, 12:08 AM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 941
Thanks: 7
Thanked 95 Times in 95 Posts
WolfShade is an unknown quantity at this point
If you are using FireFox or Chrome, open an error console and see what the message is. If you are using IE, look for a yellow exclamation mark in the lower-left corner of the browser; if there is one, double click it to open an error console.
WolfShade is offline   Reply With Quote
Old 04-30-2012, 12:14 AM   PM User | #3
Tjerfer
New to the CF scene

 
Join Date: Apr 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Tjerfer is an unknown quantity at this point
I have opened up the error consoles for both chrome and firefox and there aren't any errors. So I believe I am missing a step in the program that allows me to continually fire the mouseover event, but I don't know where.
Tjerfer is offline   Reply With Quote
Old 04-30-2012, 02:52 AM   PM User | #4
Tjerfer
New to the CF scene

 
Join Date: Apr 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Tjerfer is an unknown quantity at this point
yay, i finally figured it out.
Tjerfer is offline   Reply With Quote
Old 04-30-2012, 03:16 AM   PM User | #5
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 941
Thanks: 7
Thanked 95 Times in 95 Posts
WolfShade is an unknown quantity at this point
What was the issue? If you don't mind my asking. Professional curiosity.

^_^
WolfShade is offline   Reply With Quote
Old 05-01-2012, 12:28 AM   PM User | #6
Tjerfer
New to the CF scene

 
Join Date: Apr 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Tjerfer is an unknown quantity at this point
in the mouseout function i wrote

$('#nav li ul a').hide();

it should have been

$('#nav li ul').hide();
Tjerfer is offline   Reply With Quote
Reply

Bookmarks

Tags
drop down, navigation menu

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 04:29 PM.


Advertisement
Log in to turn off these ads.