Help needed regarding page in an iframe

Suppose i want to load a site in an iframe i would use the following code

Code:
<iframe src="http://www.techenclave.com/" width="640" height="500" id="myframe" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"> Your Browser Do not Support Iframe</iframe>

the above code when loaded shows Techenclave.com starting from its top left corner, inside the iframe dimensions.

My question is what if i just wanted to show the desired portion of the webpage i desired and not starting from top-left corner (say something exactly in the middle of the page ) inside the iframe?

What changes should i make to the code to make it work that way????
 
Option 1: Try and see if the page that you are loading has any anchor to the desired area. If it does, then you can simply load it as http://www.techenclave.com/whatever.htm#<name_of_the_anchor_here>.

Option 2: After the iframe has loaded, use a JavaScript function (body onLoad) and to do a iframeObj.scrollTop = n. If you want to be exactly in the middle, do a iframeObj.scrollTop = iframeObj.scrollHeight / 2;
 
Hey what if my iframe has an attribute value of Scrolling = "no" will this work...because this javascript involves scrolling on body onload..

I'll try it first...
 
Back
Top