Bug setting width of iframe element on window resize

Bug setting width of iframe element on window resize

Using jquery 3.0.0

when setting the width of an element:
  1. iframe.width(100px) ;
this will work correctly.

but if your code within a window.resize function looks like this:
  1. iframe.width(100px);
  2. iframe.css('padding', 2*10);

then the iframe will grab the padding & border, and the end CSS will look like this:

  1. width: 142.667px;
  2. padding: 20px;


JS code:
  1. $(window).resize(function () {
  2.       var frame = $('iframe');
  3.       frame.width(100);
  4.       frame.css('padding', (20));
  5. });
HTML:
  1. <iframe></iframe>