iframe help? arrgghhh

  • ReLapse
  • Born
  • Born
  • ReLapse
  • Posts: 2

Post 3+ Months Ago

Hi iam relatively new to iframes and i made a site using them.

Iam also having trouble with them. If you go here http://www.defianceworldwide.net/sample you will see the news content off to the center.

I know how to move it so it fits the layout picture but if u grab the edge of your browser and drag it left or right you will see how the layout image moves with the resize so its always in the middle.

What i cant figure out is how to make it so the iframe moves with it.

ANY help will be of value. Thanks


NOTE : to view source please goto view then source in your browser as i have a no right click script.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think the problem is in your positioning and is probably this line as best I can tell:

Code: [ Select ]
<div id="Layer1" style="position:absolute; width: 558px; height: 322px; z-index: 1; left:7px; top: 69px;">


Your iframe is sitting exactly where you told it to - 7px left and69 px from the top. Try percentages instead of pixels. However, a word of warning. I tried for four hours the other day to do something very similar and I could get it exactly where I wanted it at 1024x768, but then when I checked other resolutions and various window sizes it was off center.

I suppose a workaround would be to write a a javascript that detects the screen resolution and then writes the div tag based on the screen res with the appropriate positioning percentages. To me, since it was just an experiment it wasn't worth the effort to write the script for it -- however, if you really need to do it the way you are - it might be worth your effort to give it a shot.

As a side thought experiment with NOT using "left" in your absolute position and use align="center" in your div tag instead.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think this might work for you.

Read lostinbeta's reply (3rd post down) in this thread:
http://ozzu.com/viewtopic.php?t=1656

It's relative to centering a flash movie -- but it should work identically with what you are trying to do with your iframe.

I was trying to do exactly the same thing with graphics and some other stuff the other day -- but it should solve your problem.

Post Information

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

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