Hello
I would like to achieve a goal but I found it so hard, in a webpage if someone point on a link a snap shot open and contain an iframe of the webpage of that url that user points on it. I also ask how to control width and height of the iframe when it is larger page a scroll bar appears.
Some people wants only a screen capture of the page of the url, but I am asking for an iframe instead.
Thank you
Snap an iframe
Moderator: General Moderators
Re: Snap an iframe
A reference to the iframe element is obtained via its id attribute. Theoretically, this should allow for script control of attributes like scrolling and frameborder. In practice, modifying these attributes in script may have no effect. You can use the reference to the iframe element to set its style and src properties with more consistent results.
a simple example:
in detail
Web Development Services
a simple example:
Code: Select all
var iframeElement = document.getElementById(id);
iframeElement.style.width = "600px";
Code: Select all
function setIframeHeight(id, h) {
if ( document.getElementById ) {
var theIframe = document.getElementById(id);
if (theIframe) {
dw_Viewport.getWinHeight();
theIframe.style.height = Math.round( h * dw_Viewport.height ) + "px";
theIframe.style.marginTop = Math.round( (dw_Viewport.height -
parseInt(theIframe.style.height) )/2 ) + "px";
}
}
}
window.onload = function() { setIframeHeight('ifrm', .8); }
window.onresize = function() { setIframeHeight('ifrm', .8); }
Web Development Services