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 07-08-2008, 12:40 PM   PM User | #1
skmd
New Coder

 
Join Date: Dec 2007
Posts: 96
Thanks: 8
Thanked 1 Time in 1 Post
skmd is an unknown quantity at this point
Exclamation jQuery help

Hi everybody:
I'm new to jQuery , I need after event to do an effect and after the effect completed do another effect, I tried to do it this way:
Code:
function hide(){
$('#output1').fadeIn('slow');
$('#add-comment').slideUp('slow');
}
but they appeared in the same time, can anybody help me with this.
skmd is offline   Reply With Quote
Old 07-08-2008, 12:50 PM   PM User | #2
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
Jquery's fadeIn() method takes a 'callback' method as a second, optional argument.

This would be the action it takes after completing the primary action.

e.g.
Code:
function hide() {

	$('#output1').fadeIn('slow', function() { $('#add-comment').slideUp('slow')});

}
More info:
http://docs.jquery.com/Effects/fadeIn#speedcallback

Last edited by Bill Posters; 07-08-2008 at 01:10 PM.. Reason: Slight code correction
Bill Posters is offline   Reply With Quote
Users who have thanked Bill Posters for this post:
skmd (07-08-2008)
Old 07-08-2008, 12:57 PM   PM User | #3
skmd
New Coder

 
Join Date: Dec 2007
Posts: 96
Thanks: 8
Thanked 1 Time in 1 Post
skmd is an unknown quantity at this point
I tried to do it before but it didnt work. and your function has a missing $ sign
Code:
function hide() {

	$('#output1').fadeIn('slow', function() {$('#add-comment').slideUp('slow')});

}
But thanks anyway
skmd is offline   Reply With Quote
Old 07-08-2008, 01:11 PM   PM User | #4
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
(Code example update)


It should work fine. The problem may be elsewhere in your code.

Are you getting any errors reported?
Are you able to post the url?
Bill Posters is offline   Reply With Quote
Old 07-08-2008, 01:32 PM   PM User | #5
skmd
New Coder

 
Join Date: Dec 2007
Posts: 96
Thanks: 8
Thanked 1 Time in 1 Post
skmd is an unknown quantity at this point
Yes there was an error somewhere else in my code it works like a magic.
Thank you very much
skmd is offline   Reply With Quote
Old 02-19-2012, 05:53 AM   PM User | #6
yoguerilla
New to the CF scene

 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
yoguerilla is an unknown quantity at this point
Hi all!


I'm a complete novice when it comes to javascript and jquery.

I've just put a jquery photo gallery on my website http://renaissanceboutique.com.au/

It looks great, but the problem is that the gallery javascript conflicts with the wordpress theme javascript that controls the sliding menus in the left hand sidebar.

Is there a simple way that I can solve this?


Thank you!
yoguerilla 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 03:13 PM.


Advertisement
Log in to turn off these ads.