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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:01:09+00:00 2026-05-26T05:01:09+00:00

Is possible to animate() the width of an element making a smooth center animation?

  • 0

Is possible to animate() the width of an element making a smooth center animation?

I mean animate making the element fixed on itself centered on himself x coordinates?

if i do :

<a class="animate">hey</a>
$('.animate').animate({'width':'+=1%'},500);

it works but the element is animated on the right and not from the center of himself

  • 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-26T05:01:10+00:00Added an answer on May 26, 2026 at 5:01 am

    Yes, you’ll have to move the element also.

    <a class="animate" style="display:block; width:300px; border:1px solid #000; position:fixed; top:50px; left:50px;">hey</a>
    jQuery(".animate").animate({'width':'0px', 'left':'200px'});
    

    http://jsfiddle.net/7Ysbg/

    New Information

    So you mean something like this: http://jsfiddle.net/7Ysbg/2/

    jQuery(".animate").click( function(){
        var w = jQuery(".animate").width();
        var new_w = jQuery(".animate").width()*1.5;
        var left = jQuery(".animate").offset().left - ((new_w - w)/2);
        jQuery(".animate").animate({'width':new_w+'px', 'left':left+'px'}, 'fast');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to animate a html5 video element <div id=cont> <video id=movie width=320
Does any one know if its possible to animate app.current.mainwindow.width so that you get
Is it possible to smoothly animate the width of a table. Ten percent per
Is possible to set width auto on animate? for example : $(this).animate({width: 400px}, 'slow');
initially i am showing jquery dialog with fixed height and width at center of
Using keyframes , it is possible to animate an element as soon as it
Is it possible to animate the change of a UIProgressView such that the display
Possible Duplicate: Can you animate a height change on a UITableViewCell when selected? This
I would like to animate things in 3D space. I know this is possible
Possible Duplicate: jQuery animate backgroundColor Is it possible to animate/transition the background-color of a

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.