Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个宽度为 20% 的类,如何创建一个 jquery 函数来将类高度更改为与类相同的宽度,但以像素为单位?
工作演示
尝试这个
var pixels = parentWidth*(percent/100);