在做collapse組件時,用到這個功能,結果答案基本一致。 思路基本如下: clone element append to body show the hide element get the property remove the clone element 參考 StackOverflow StackOverflow