Alp Eren Gül
Alp Eren Gül

Reputation: 103

JQuery Css speed implementation

I want to make a border-bottom to my li with a speed. How can I solve this?

My code:

    $(document).ready(function(){
        $("#mi").mouseover(function(){
            $("#mi").css({"border-bottom": "1px solid #fff"});
        },800);
    });

Upvotes: 0

Views: 46

Answers (1)

Barmar
Barmar

Reputation: 781726

You need to animate the border-bottom-width property.

$(document).ready(function() {
  $("#mi").mouseover(function() {
    $("#mi").css({
      "border-bottom": "0px solid #fff"
    }).animate({
      borderBottomWidth: 1
    }, 500);;
  });
});

Upvotes: 1

Related Questions