Selective iFrame

  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Joined: Dec 14, 2003
  • Posts: 411
  • Loc: USA
  • Status: Offline

Post December 21st, 2010, 7:18 am

Guys,

Have been doing a bit of research on the following but haven’t had much luck. Is there any way to create an iframe that focuses on a particular segment of a page? For example, say there is a page1 with dimensions of 800x1000, and I want to place an iframe in a different page2 that links to page1 and focuses on a particular portion, say 400x100 of the page1 site.

Is that possible?

Thanks gang!
Forela.com
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 21st, 2010, 7:18 am

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post December 21st, 2010, 10:40 am

what do you mean by focus? If you mean giving an element like a form or link focus then javascript will do this.
^__^
  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Joined: Dec 14, 2003
  • Posts: 411
  • Loc: USA
  • Status: Offline

Post December 21st, 2010, 11:52 am

tastysite wrote:
what do you mean by focus? If you mean giving an element like a form or link focus then javascript will do this.


For example, picture this current page we're in. I am wondering if it would possible to display through an iframe only a portion of this page -- say the main discussion area titled "Selective iFrame". So, the goal would be to display the content in this page through an iframe, but only show the main discussion area, and not the side menu, header, etc.

Does that make better sense?
Forela.com
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post December 21st, 2010, 1:09 pm

If you knew the dementions of the page yes, and you would need an anchor link to supply to the iframe. You could disable the spidebars so that you couldnt scroll aswell.

Is there any reason your doing this with iframes and not server side code?
#define NULL (::rand() % 2)
  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Joined: Dec 14, 2003
  • Posts: 411
  • Loc: USA
  • Status: Offline

Post December 21st, 2010, 2:16 pm

SpooF wrote:
If you knew the dementions of the page yes, and you would need an anchor link to supply to the iframe. You could disable the spidebars so that you couldnt scroll aswell.

Is there any reason your doing this with iframes and not server side code?


Thanks SpooF - I am just exploring the concept with one of my websites. Using anchor links might work out.
Forela.com
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post December 21st, 2010, 2:49 pm

One thing to note about anchor links.

They like to be position on the top of the page and to the furthest right.

On a normal page this forces the page to be scrolled as far to the left side of the page as it can be.
#define NULL (::rand() % 2)
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post December 23rd, 2010, 11:01 am

could you not just load the iframe "as is" with sidebars and all and then use some css to hide everything else ie display:none, if you did this the frame could also be any size as you could set the content to be whatever size you want.
^__^
  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Joined: Dec 14, 2003
  • Posts: 411
  • Loc: USA
  • Status: Offline

Post December 23rd, 2010, 12:21 pm

tastysite wrote:
could you not just load the iframe "as is" with sidebars and all and then use some css to hide everything else ie display:none, if you did this the frame could also be any size as you could set the content to be whatever size you want.


How would that work from a code point of view. Would you simply place a CSS class on the iframe which sets display:none to different classes that appear inside the frame? Not sure how that looks...
Forela.com
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post December 24th, 2010, 6:23 pm

I would shy away from using an iFrame since they're a bit hard to deal with. Does it need to be a physically separate page? For example you don't host/control the content?

If not I would highly suggest placing all the content on one page, wrapping it with a fixed size div with the overflow set to hidden and then controlling the position of the content using margins. This solution is going to be a lot easier to control and manipulate down the road.

If you don't control the page you could use the same process as above but fill in the content with an AJAX call instead of having it live on the page.

iFrames just seem like a really hacky solution that won't give you much control over what you need.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.