Situation: I\'m working on a responsive design that involves the typical HTML/CSS combo. Everything is working nicely except in one case where there is an i
This is how I would do it, code is much shorter: http://jsfiddle.net/TBJ83/2/
I did it that way for read-ability, but you could make it even shorter and faster...
function setIFrameSize() {
f = $("#myframe");
f[0].setAttribute("width", f.parent().width());
f[0].setAttribute("height", f.parent().height());
}
One selector, so you only look through the DOM once instead of multiple times.