jQuery CSS plugin that returns computed style of element to pseudo clone that element?

后端 未结 9 1158
长情又很酷
长情又很酷 2020-11-22 15:27

I\'m looking for a way using jQuery to return an object of computed styles for the 1st matched element. I could then pass this object to another call of jQuery\'s css method

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 15:47

    Now that I've had some time to look into the problem and understand better how jQuery's internal css method works, what I've posted seems to work well enough for the use case that I mentioned.

    It's been proposed that you can solve this problem with CSS, but I think this is a more generalized solution that will work in any case without having to add an remove classes or update your css.

    I hope others find it useful. If you find a bug, please let me know.

提交回复
热议问题