How do I set the width and height of a hidden element by using another hidden element's width and height?
for(i=1;i<10;i++){
$('#hiddenE1'+i).width($('#hiddenE2'+i).width()).height($('#hiddenE2'+i).height());
}
There is no width when display: none. One trick would be to set position: relative; margin-left: -9999px;. It will not show on the page but preserve the width. Or, use visibility: hidden. The only downside is it will not rip it out of the layout but leave a blank spot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With