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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:28:35+00:00 2026-06-05T20:28:35+00:00

I’m trying to create a small slider where jquery UI Scale brings out and

  • 0

I’m trying to create a small slider where jquery UI Scale brings out and image Div and scales out the first one. My problem is, when it gets scaled in Google Chrome it shakes a bit while its in the process of scaling. In IE or firefox it works like a charm no vibrating/shaking at all!

Now I tested that when I don’t use background-position:center in css it doesn’t shake anymore but If i take this out then it doesn’t look like its being zoomed out from the center of the image anymore.
What can I do to get rid of this?
Here is an example(Open it with Chrome) http://jsfiddle.net/gqLZe/

  • 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-05T20:28:36+00:00Added an answer on June 5, 2026 at 8:28 pm

    Putting the animation in slow motion (very long duration), I can see that the bottom of the div actually moves up a pixel occasionally – which is what is causing the shaking. Watching it in the style inspector, I can see that jQuery is setting each of the position properties of the div to a decimal, and the position of the div actually changes each time one of those decimals passes a whole number. Since the top and height don’t necessarily pass a whole number at that same time, you get the shaking. On the other hand, the left and width do appear to always pass a whole number at the same time, though I can’t tell for sure whether that’s the case. In any case, I haven’t been able to distinguish any horizontal shaking.

    Apparently Chrome is truncating any decimals in the position properties, whereas the other browsers are using floating-point arithmetic to calculate the boundary of the div in absolute coordinates before any rounding or truncating. I’m not sure whether this qualifies as a bug or not (would have to examine the spec), though it’s likely something that will get fixed/improved eventually. It probably does qualify as a bug in jQuery, since jQuery is supposed to work around such browser peculiarities.

    Fixing this problem requires providing a different scaling algorithm. One solution is to compute in JavaScript the values that the other browsers are computing automatically, and provide only whole numbers to Chrome, as in this jsFiddle: http://jsfiddle.net/gqLZe/1/

    That method may cause a similar problem in other browsers when a containing element has a noninteger top or left (including due to border or margin), but so long as you stick to whole numbers, it should work fine.

    An alternate solution would be to provide a parent element of the size that you want the div to expand to, and animate on right and bottom rather than on width and height. This can be done very simply using jQuery’s animate():

    var width = $(".frame").width();
    var height = $(".frame").height();
    $(".frame").css({
        top: height / 2 + "px",
        bottom: height / 2 + "px",
        left: width / 2 + "px",
        right: width / 2 + "px"
    }).show().animate({
        top: 0,
        bottom: 0,
        left: 0,
        right: 0
    }, 3000, 'linear');
    

    jsFiddle: http://jsfiddle.net/gqLZe/3/

    That’s probably the way to go, if you can endure having an extra markup element.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am reading a book about Javascript and jQuery and using one of the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.