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 06-11-2009, 03:43 PM   PM User | #1
rufus:
New to the CF scene

 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
rufus: is an unknown quantity at this point
very annoying little jQuery problem

hey guys, iv been doing this new site for my uncle and i want to toggle the text box on the page to show and hide the picture behind. iv been stuck on this for ages and im getting a bit frustrated so i wondered if anyone can help!

the web address is (for the time being) www.yunitube.co.uk

i hope someone can shed some light for me. i have used this bit of simple code as well as referring to the jquery library at the start of the page:

$(document).ready(function() {
$("#v_toggle").click(function() {
$("#vertical_slide").toggle();
});
});

for some reason i cant get it to work. basically, i would like the user to click the question mark on the page and it shows and hides the text box.. ok im repeating myself now.

im not really sure if it is a problem with the jquery, or i have done something naughty that the css doesnt like...

i dont know!

please help!

THANKS
rufus: is offline   Reply With Quote
Old 06-11-2009, 03:50 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
You must not use <script> tags within external .js files.
venegal is offline   Reply With Quote
Old 06-11-2009, 03:55 PM   PM User | #3
rufus:
New to the CF scene

 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
rufus: is an unknown quantity at this point
it pains me to admit that i didnt know that before posting.. it still doesnt work even now though, when i changed them! im thinking it might have something to do with the slideshow jquery or something?!

thanks for your reply!

Last edited by rufus:; 06-11-2009 at 03:57 PM..
rufus: is offline   Reply With Quote
Old 06-11-2009, 04:02 PM   PM User | #4
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
You have to be careful regarding the order in which you load external .js files. The way you are doing it right now, you are trying to use jQuery methods before even having loaded jQuery. Just load your own script last, after having loaded all the framework stuff, and not first, like you are doing now.

Also, use a Javascript debugger, like Firebug. If your scripts are dying silently you won't ever have a chance of finding out why they won't work.
venegal is offline   Reply With Quote
Users who have thanked venegal for this post:
rufus: (06-11-2009)
Old 06-11-2009, 04:05 PM   PM User | #5
rufus:
New to the CF scene

 
Join Date: Jun 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
rufus: is an unknown quantity at this point
ohhh... man that's awsome, thanks so much.

i knew it would be something so simple, and stupid. i always stumble up.

all the best!
rufus: is offline   Reply With Quote
Reply

Bookmarks

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 10:13 PM.


Advertisement
Log in to turn off these ads.