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

  • SEARCH
  • Home
  • 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 8833439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:46:46+00:00 2026-06-14T08:46:46+00:00

I have this function here $(document).keydown(function(e){ if (e.which == 39) { goRight(); } if

  • 0

I have this function here

$(document).keydown(function(e){
        if (e.which == 39) {
            goRight();
        }
        if (e.which == 37) {
            goLeft();
        };
    });

And I want that: if I press the right or the left arrow keys, calling any of my functions (goRight or goLeft), I can only execute the other key pressing action after the function do it’s job. What I want is similar to the stop() function to animations. Because when I press left/right very quickly all my margin get bugged.

The goRight function is this

function goRight(){
                if(!$('.livin').hasClass('blog') ){
            $('#contentGeral .containerConteudo ul').stop().animate({marginLeft:'-=800'},function(){
                    removeClasses();
                    addClasses();
                });
            }
            else{
                $('#contentGeral .containerConteudo ul').stop().animate({marginLeft:'0'}, function(){
                    removeClasses();
                    addClasses();
                    });
            }
    }

The goLeft is analogous.

Thanks in advance for the help!

  • 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-14T08:46:48+00:00Added an answer on June 14, 2026 at 8:46 am

    The method .stop(true,true) made this work. Thanks 3nigma for the tip.

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

Sidebar

Related Questions

Here is the situation. I have some javascript that looks like this: function onSubmit()
Here's the story... I have a jQuery function that does something, this function is
So I have this function here: function ShowMessage() { var themessege = document.getElementById(Form).textarea1.value; var
I have this function (sample here: http://jsbin.com/emabe4/ ) var a=[]; var log = document.getElementById('log');
I have this simple function: <script type=text/javascript> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); });
My javascript function looks like this - function updateSuccess(aEle) { //Here aEle doesn't have
Code is not running on .click when I have this: $(.cancel).click(function() { alert(got here);
I have this code here: var Person = (function() { var name; var PersonConstructor
Maybe I'm, just tired but I have a right click menu that I want
So, at my school theyy have this service which tells you that your request

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.