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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:50:16+00:00 2026-06-07T11:50:16+00:00

I’m currently working on a simple interactive map for my company’s website. We are

  • 0

I’m currently working on a simple interactive map for my company’s website. We are trying to move away from flash entirely.

What I’m doing is, is making points on the map as css circles (link with background color and css3 rounded corners) that, when hovered over, expand in size slightly.

The problem I’ve come across is that the hover animation isn’t perfectly smooth. Due to the nature of the circles, in order for them expand outward on hover without moving downward, I had to make the location of the circle move slightly (-5 pixels on the top and left at the end of hover animation). When I take the mouse off, it hovers back down to the original size and position, however it jumps a pixel and looks messy sometimes.

Here is the link to my current prototype: http://clients.taylordesign.com/td/map_v02/interactive-map.html

So is there a way to make the animation perfectly smooth?

I’m looking at this on a Mac, snow leopard, chrome, firefox.

$(document).ready(function(e) {

$('a.location').each(function() {

    var pos = $(this).find('span').position();
    var posLeftHover = (pos.left - 5);
    var posTopHover = (pos.top - 5);

    $(this).hover(function() {
        $(this).find('span').stop(true, false).animate({
            height: '25px',
            width: '25px',
            left: posLeftHover,
            top: posTopHover
        }, 200);
    }, function() {
        $(this).find('span').stop(true, false).animate({
            height: '15px',
            width: '15px',
            left: pos.left,
            top: pos.top
        }, 200);
    });
});

});
  • 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-07T11:50:18+00:00Added an answer on June 7, 2026 at 11:50 am

    I would try to put the span in a 25×25 box and vertically and horizontally align it to center within that box using CSS. Then you don’t need to animate the position, just the size. I think that will give you a smoother look.

    http://jsfiddle.net/9LXSv/

    CSS:

    .box {width:25px; height:25px; text-align:center; position:absolute;}
    .dot {width:15px; height:15px; vertical-align:middle; background:red; display:inline-block;}​
    

    HTML:

    <div class="box" style="left:100px; top:100px;">
      <span class="dot"></span>
    </div>
    
    <div class="box" style="left:200px; top:100px;">
      <span class="dot"></span>
    </div>
    ​
    

    JS:

    $(document).ready(function(e) {
    
      $('.box').hover(function() {
        $(this).find('span').animate({
          height: '25px',
          width: '25px'
        }, 200);
      }, function() {
        $(this).find('span').animate({
          height: '15px',
          width: '15px'
        }, 200);
      });
    });
    
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.