I want to draw a border around my links on hover, with animation smth like this http://d2fhka9tf2vaj2.cloudfront.net/tuts/152_QTiPad/Milestones/JavaScriptWebsite.html
Please give me some snippets or links.
Thank you
This is how i tried to animate it with jquery
$('a').on('hover', function() {
$(this).animate({ border: '1px' }, 'slow', 'linear');
$(this).animate({ border: 'solid' }, 'slow');
$(this).animate({ border: '#ccc' }, 'slow');
});
If you Have no Idea To like this:)
See fiddle:Click me
you can check this pen.the technique used is css transitions, no jquery involved what you do need is like tannerjohn said, a div for each side of button
http://codepen.io/ASidlinskiy/pen/xeBiq?editors=110
html:
css:
OK, So i checked out the site, seems they are using a custom animation handler. Here, this is the external js file that handles all the custom animation.
Custom Handler
Now what you have to do is create multiple divs for each line. Then customize it the way you want. If you want to have the exact same look-
For the horizontal divs,
For the vertical divs, just change
border-bottom
toborder-left
.Now the jquery,I'll try to explain how the custom handler works, if you directly wan to copy paste,
Here you go .
First you define the div you want to animate,
$fx('#theHeader1')
then you add the parameters for making the animation work.fxAdd({type: 'width', from: 0, to: 770, step: 10, delay: 10})
, here-