Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, this became challenging.</p> <p>Having in mind that your divs are circular:</p> <p>Use a wrapper (another div) for every one of your divs, bigger than them, center your divs in the wrappers (vertically and horizontally) as "inline-block" and then animate them.</p> <p>Every border has to be animated independently to work well ("borderLeftWidth", "borderRightWidth", etc. instead of just "borderWidth"). It's a not very well documented bug in jQuery: <a href="http://bugs.jquery.com/ticket/7085" rel="nofollow">http://bugs.jquery.com/ticket/7085</a> (it was hard to discover).</p> <p>It seems working: <a href="http://jsfiddle.net/y4FTf/2/" rel="nofollow">http://jsfiddle.net/y4FTf/2/</a></p> <p>HTML</p> <pre><code>&lt;div class="wrapper"&gt; &lt;div class="content"&gt;Hello World! &lt;/div&gt; &lt;/div&gt; &lt;div class="wrapper"&gt; &lt;div class="content"&gt;Foo Bar &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS</p> <pre><code>.wrapper { width: 210px; height: 210px; line-height: 210px; text-align: center; padding: 0px; } .content { display: inline-block; height: 200px; width: 200px; border: solid 0px; vertical-align: middle; border-radius: 2000px; background-color: #ccc; margin: 0px; } </code></pre> <p>Javascript</p> <pre><code>$(function(){ $(".content").mouseover(function(){ $(this).animate({"borderLeftWidth" : "5px", "borderRightWidth" : "5px", "borderTopWidth" : "5px", "borderBottomWidth" : "5px" }, 300); }).mouseout(function(){ $(this).animate({"borderLeftWidth" : "0px", "borderRightWidth" : "0px", "borderTopWidth" : "0px", "borderBottomWidth" : "0px" }, 300); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload