Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9278407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:21:39+00:00 2026-06-18T17:21:39+00:00

i have a problem with toggle animation clicking – like when you click once

  • 0

i have a problem with toggle animation clicking – like when you click once and an element moves down and on the second click the element moves back up. I tried .toggle but with no success and come with this idea:

I have a function that moves a “carousel” (which is a button) down 10px [i use transit plugin]:

function carousel_4way (n, el) {

    // remove outline from clicked element
    el.blur();

    // animation
    var carousel = '#carousel-4way-nav-' + n
    var carousel_content = '#carousel-4way-' + n
        $(carousel_reset).hide();
        $(carousel).transition(
        {y: '+=10'}

        );

then i have a click of one of these carousels:

$('#carousel-4way-nav-1').click(function(event){
    return carousel_4way(1, this);
    event.preventDefault();
});

it calculates very nicely and i only need to define all the clicks for every button i want to animate.

this way i animate the buttons to move 10px down {y: ‘+=10’}
but then i would like to click them again to move up so {y: ‘-=10’} is what i need.

i mixed something like this:

function carousel_4way (n, el, m) {
$(carousel).transition(
    {y: m + '=10'}
    );


$('#carousel-4way-nav-1').click(function(event){
return carousel_4way(1, this, '+');
event.preventDefault();
});

now i just need to add to that another
return carousel_4way(1, this, ‘-‘);
and this is the place where i am stuck. is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:21:41+00:00Added an answer on June 18, 2026 at 5:21 pm

    You mean something like:

    var transitionState = '-'; // this should be global
    
    // the following will always evaluate to what transitionState currently is not (toggle)
    return carousel_4way(1, this, (transitionState == '-') ? '+' : '-'); 
    

    just make sure to update transitionState in carousel_4way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem getting an element to appear using scriptaculous Effect.toggle, I want
I have a problem with fade toggle, It works when the div is visible
I have problem while loading data into html select when users press or click
I have a problem with JQuery Toggle. I have the following code: var $_
I have a problem with this jquery script. toggle:function() { if(this.opened){ $(slideToBuyBottomBtnClosed).setStyle(display,block); $(slideToBuyBottomBtnOpen).setStyle(display,none); $(sildeToBuyContent).setStyle(overflow,hidden);
I have a problem with this Jquery function. The the simplifide code looks like:
I have a problem with my custom cells. My cell is structured like this
I have this code jQuery('.button').click(function() { jQuery('.div1').animate({width: 'toggle'}); jQuery('.div2').animate({width: '100%'}); }); Works fine for
I have a PyQt4.9 window where I would like to toggle the translucency on
I am create twitter_zombie rails fro fun. I just have one problem,when I click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.