Prev: BESEN ES5 implementation
Next: QUESTION: how to add/remove classes to web browsers Javascript implementation?
From: Andrew Poulos on 8 Apr 2010 02:36 If I open a new window (reference "pop") that contains an iframe with a PDF in it and then call this code on the window: var cBtn = pop.document.createElement("p"); cBtn.appendChild( pop.document.createTextNode("close") ); cBtn.style.position = "absolute"; cBtn.style.right = "6px"; cBtn.style.top = "6px"; cBtn.style.margin = "0"; cBtn.style.fontFamily = "Verdana, Arial, Helvetica, sans-serif"; cBtn.style.fontSize = "11px"; cBtn.onmouseout = function(){ this.style.color = "#333333"; }; cBtn.onmouseover = function(){ this.style.color = "#999999"; }; cBtn.onclick = function(){ pop.close(); }; pop.document.body.appendChild(cBtn); pop.document.body.style.overflow = "hidden"; // --> freezes here cBtn = null; "pop" "freezes" 8 times out of 10. If I comment out the line then the window opens properly and cBtn is added to the window and responds as expected. If I replace the PDF with a "typical" HTML page the window opens properly. Why would setting the overflow cause the window to freeze? Andrew Poulos
From: Thomas 'PointedEars' Lahn on 8 Apr 2010 05:30
Andrew Poulos wrote: > If I open a new window (reference "pop") that contains an iframe with a > PDF in it and then call this code on the window: > [...] > pop.document.body.style.overflow = "hidden"; // --> freezes here > [...] > > "pop" "freezes" 8 times out of 10. If I comment out the line then the > window opens properly and cBtn is added to the window and responds as > expected. If I replace the PDF with a "typical" HTML page the window > opens properly. > > Why would setting the overflow cause the window to freeze? Possibility: The PDF plugin triggered by the iframe cannot deal with cropped content. PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee |