CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery help (http://www.codingforums.com/showthread.php?t=143722)

skmd 07-08-2008 12:40 PM

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.

Bill Posters 07-08-2008 12:50 PM

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

skmd 07-08-2008 12:57 PM

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 :)

Bill Posters 07-08-2008 01:11 PM

(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?

skmd 07-08-2008 01:32 PM

Yes there was an error somewhere else in my code it works like a magic.
Thank you very much :)

yoguerilla 02-19-2012 05:53 AM

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!


All times are GMT +1. The time now is 07:39 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.