jQuery .css(“left”) returns “auto” instead of actual value in Chrome

前端 未结 5 1559
感情败类
感情败类 2020-11-30 14:49

I have div element with left and top defined, without absolute position, and I want to read the left and top values using jQuery.

Using $(\"#M

5条回答
  •  生来不讨喜
    2020-11-30 15:34

    It is strange behavior for jQuery. But you can use native javascript methods to get css values:

    $("#Panel1")[0].style.left
    

    This expression will return corresponding css property.

提交回复
热议问题