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 915189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:50:43+00:00 2026-05-15T17:50:43+00:00

I’m just getting my bearings with Javascript and jQuery, and I’m working on an

  • 0

I’m just getting my bearings with Javascript and jQuery, and I’m working on an animation.

Essentially, what’s going on is an element, #left-arrow. On hover, the arrow moves left 10px and increases opacity. I’m using the 2D Transform plugin for jQuery to handle the transform.

Now my issue, however, is that javascript will only execute it one at a time. So the arrow will move, THEN increase the opacity. The effect is sort of lost when it occurs this way.

Is there anyway I can combine these to work properly?

Here’s what I have:

<script>
    jQuery(document).ready(
        function() {
            $('#left-arrow').hover(
                function() {
                    $(this).animate({translateX:-10})
                    $(this).fadeTo('fast', 1);

                },
                function() {
                    $(this).animate({translateX:0});
                    $(this).fadeTo('fast', .8);
                }
            )
    })
    </script>

As I said, I’m quite new at this, so please be specific if you have a solution, I really appreciate it!

  • 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-05-15T17:50:44+00:00Added an answer on May 15, 2026 at 5:50 pm

    If you add opacity to your call to animate(), it’ll animate that property at the same time as your translateX property. For example:

    jQuery(document).ready(function() {
        $('#left-arrow').hover(
            function() {
                $(this).animate({translateX:-10, opacity: 1});
            },
            function() {
                $(this).animate({translateX:0, opacity: 0});
            }
        );
    
        $('#right-arrow').hover(
            function() {
                $(this).animate({translateX:10, opacity: 1});
            },
            function() {
                $(this).animate({translateX:0, opacity: 0});
            }
        );
    });
    

    I’ve combined your two calls to document.ready() into a single call, too.

    EDIT: Also, if you’re just moving your elements left and right and not doing any crazy rotation/scaling/etc., you can get away with making the element’s position relative and just animating the ‘left’ property.

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

Sidebar

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.