0

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);
    });
7
  • What do you mean by "with a speed"? Commented Dec 30, 2019 at 19:58
  • Do you mean you want the border to fade in? Use .animate(). Commented Dec 30, 2019 at 19:59
  • withput animation I want to make a border-bottom with a slow motion. Commented Dec 30, 2019 at 20:34
  • I think you have to use .animate(). See stackoverflow.com/questions/16793360/… for an example. Commented Dec 30, 2019 at 20:41
  • $(document).ready(function(){ $("#mi").mouseover(function(){ $("#mi").css({"border-bottom": "0px solid #fff"}).animate({ borderbottom: 1 }, 500);; }); }); I tried this but it doesnt work. Commented Dec 30, 2019 at 21:02

1 Answer 1

1

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);;
  });
});

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.