JQuery UI Highlight Effect - How can I use a border?
1 answer
jQuery .effect()
just applies pre-built animations to your element. as Daniel points out, the highlight effect doesn't seem to work on the borders.
instead, you can use jQuery .animate()
to animate your div manually:
$("div").click(function() {
$(this).animate({
"background-color": '#effdeb',
"border-color": "32a511",
"border-width": "2px"
}, 500);
});
div {
width: 100px;
height: 100px;
display: inline-block;
border: 1px solid black;
box-sizing:border-box;
}
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<div></div>
<div></div>
<div></div>
<div></div>
+2
source to share