Animate Border of Img - ADD COLOR THIEF EXAMPLE
by bizamajig
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/base/jquery-ui.css">
<div>
<img src="http://25.media.tumblr.com/acc96259d6b2678985052c33e05a3062/tumblr_mkv9fhDBDS1rmc58qo1_500.jpg" />
</div>
CSS
body {
margin:50px;
}
.tooltip {
position: absolute;
z-index: 1020;
display: block;
padding: 5px;
font-size: 11px;
visibility: visible;
margin-top: -2px;
bottom:120%;
margin-left: -2em;
}
.tooltip .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-top: 5px solid #000000;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
position: absolute;
width: 0;
height: 0;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: #000000;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.ui-slider {
background: black repeat-x bottom left;
border-bottom: 1px solid #EBEAE5;
height: 15px;
margin: 0;
padding: 0px;
}
.ui-slider-handle {
background: #ED6B51;
border-bottom: 1px solid #a8a79f;
border-right: 1px solid #a8a79f;
height: 20px;
width: 10px;
margin: 0;
padding: 0px;
display: inline-block;
}
.ui-slider-range {
height: 10px;
border-bottom: 3px solid red;
position: relative;
}
.ui-slider-handle {
background: #ED6B51 !important;
border-bottom: 1px solid #a8a79f !important;
border-right: 1px solid #a8a79f !important;
height: 20px !important;
width: 10px !important;
margin: 0 !important;
padding: 0px !important;
display: inline-block !important;
top: -4px !important;
}
JavaScript
$('div img').mouseenter(function () {
$(this).css({
outline: "4px solid transparent"
}).animate({
outlineWidth: '4px',
outlineColor: '#f37736'
}, 200);
}).mouseleave(function () {
$(this).animate({
outlineWidth: '4px',
outlineColor: 'transparent'
}, 200);
});