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



Reply
Old 01-01-2009, 01:59 PM JQuery Problem
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
PHP Code:
<script type="text/javascript">
$(
document).ready(function(){

$(
'#feedback').hide('');

$(
'a#1').click(function(){
$(
'#feedback').toggle('');
});


});
</script> 
It doesn't toggle the feedback div, but if you use show instead of toggle the script works.
MoForce is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-01-2009, 05:36 PM Re: JQuery Problem
editme's Avatar
Novice Talker

Posts: 14
Name: Matt Wiseley
Location: New England, U.S.
Trades: 0
I don't see anything syntactically wrong with the sample you provided, but it's also not a complete sample. One thing that can be useful for debugging issues like this is to create an extremely simple HTML document that does just the one thing you're trying to do. Often, you'll find it works there, and you can start adding stuff back until it stops to determine the cause of the malfunction.

I seem to recall having trouble with toggle at some point. Why not just use show/hide if it works?

Matt
__________________
EditMe - Bringing the power of wikis to websites of all kinds.

Please login or register to view this content. Registration is FREE
editme is offline
Reply With Quote
View Public Profile Visit editme's homepage!
 
Old 01-01-2009, 05:38 PM Re: JQuery Problem
editme's Avatar
Novice Talker

Posts: 14
Name: Matt Wiseley
Location: New England, U.S.
Trades: 0
On second look, why are you passing an empty string '' to the toggle function? That doesn't make sense. See http://docs.jquery.com/Effects/toggle

Try changing toggle('') to toggle() and see if that fixes it.

Matt
__________________
EditMe - Bringing the power of wikis to websites of all kinds.

Please login or register to view this content. Registration is FREE
editme is offline
Reply With Quote
View Public Profile Visit editme's homepage!
 
Old 01-02-2009, 01:23 AM Re: JQuery Problem
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
Quote:
Originally Posted by editme View Post
On second look, why are you passing an empty string '' to the toggle function? That doesn't make sense. See http://docs.jquery.com/Effects/toggle

Try changing toggle('') to toggle() and see if that fixes it.

Matt
I got it to work

Thank You!
MoForce is offline
Reply With Quote
View Public Profile
 
Old 01-05-2009, 02:27 AM Re: JQuery Problem
Skilled Talker

Posts: 55
Name: Mike
Trades: 0
Yes, never pass an empty string. If you don't need to pass anything just use () instead of ('').
XBSHX is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to JQuery Problem
 

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