/    Sign up×
Community /Pin to ProfileBookmark

Help w/ jQuery Click Toggle Functions

Now that .toggle() has been removed from jQuery, I’m stuck on a particular script:

[CODE]jQuery(“#cornerBtn”).click(function(e) {
jQuery(this).toggleClass(“active”);
jQuery(“#overlayContainer”).slideToggle(500, “swing”, function() {
jQuery(“#overlay .box”).fadeIn();
});
e.preventDefault();
});[/CODE]

This works fine. But when the button is clicked again — I need the #overlay .box DIV to fade out BEFORE the slideToggle is triggered again.

In the past, I would have just used .toggle() and created two sets of functions. Any recommendations?

Thank you for your help.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@rootFeb 13.2014 — Suggest that you ask in the JQuery (frameworks) forum. This is a JavaScript forum not a frameworks forum.
Copy linkTweet thisAlerts:
@msmith29063authorFeb 14.2014 — Will do. Thanks.
×

Success!

Help @msmith29063 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...