iFrame's width height is not set dynamically..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    iFrame's width height is not set dynamically..

    Code:
    var iFrame = document.createElement('IFRAME');
    		iFrame.name = 'frame';
    		iFrame.id = 'frame';
    		iFrame.addEventListener("load",function(){
    			var w = getDocWidth('frame');
    			var h = getDocHeight('frame');
    			alert(w+'\t'+h);
    			iFrame.width = w + 'px';
    			iFrame.height = h + 'px';
    		},true);
    		document.body.appendChild(iFrame);
    		frames['frame'].location.href = 'span_test.html';
    is this a right way to set the width height of an iFrame dynamically?
  • larztheloser
    New Member
    • Jan 2010
    • 86

    #2
    should be iFrame.style.wi dth, same for height

    Comment

    Working...