Selective iFrame

  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Posts: 409
  • Loc: USA

Post 3+ Months Ago

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!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

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
  • Posts: 409
  • Loc: USA

Post 3+ Months Ago

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?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

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?
  • Dragon
  • Proficient
  • Proficient
  • User avatar
  • Posts: 409
  • Loc: USA

Post 3+ Months Ago

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.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

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.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

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
  • Posts: 409
  • Loc: USA

Post 3+ Months Ago

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...
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 65 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.