Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • HTML & DHTML (Moderator: De KoFfieŠ) »
  • Iframe positioning help
« previous next »
  • Print
Pages: [1]

Author Topic: Iframe positioning help  (Read 4469 times)

Offline Zerlina

  • The Cloud that Rains on Your Parade
  • Exemplar
  • *
  • Posts: 1,871
Iframe positioning help
« on: July 18, 2005, 06:09:13 PM »
Hey, all you html experts out there.

I'm working on my game website, and I'm having trouble.


http://www.freewebs.com/palisgame/

The problem is that I'm trying to put an iframe over an image. In 800x600 resolution, the iframe is in the right place, but in 1024x768 + it's always too far to the left. How would I fix this? I thought of putting the image on a layer, too, but then it would always be off-centre.

Any help appreciated.


Logged
Quote from: lucas_irineu
You look like my grandmother.
edit: when she was young. You don't look like you're 80.

Quote from: Dragonium
Last night I had a dream that Zerlina and I were pirates. It was... beautiful.

Offline Sqoad

  • Artist (abit rusty at that...)
  • Associate
  • *
  • Posts: 216
  • Look at my avatar and imagine it realistic, That's my face.
(No subject)
« Reply #1 on: July 18, 2005, 11:55:16 PM »
I used to work a little with that... But I have forgotten most of it...
Well you COULD look for a html guide or something... But... You could try asking someone who has his/her own website... Or wait until someone more intelligent wants to help :|

EDIT: Pretty good so far though XD
Logged
I can edit b-/chars for you. I am however usually not avaliable. I prefer chosing the one I help...
-Favorite B-char type: Narikiri (is that the name?)
-Favorite Char type: Medium, with emotes.

Offline AsakuraHao2004


  • RAM-TORTOISE!!
  • Exemplar
  • *
  • Posts: 1,623
  • AIM: dakutenshisdemon YIM: desimodontidae
(No subject)
« Reply #2 on: July 19, 2005, 01:19:39 AM »
The obvious thing, have you closed your iframe tag? Something like that happened to me, almost exactly like what you're describing. Turns out I forgot to close the iframe tag.

Changing resolution size changes picture sizes, no? That way, if you have the ifame set to a specific width and height, it wont change when the image does (or, it will, but it causes problems). (course, Im hazy with that, not too sure... I dont change resolustions much)

Also, when putting an iframe over an image, it might be best to use tables. Set the image as a TD background. Thats what I use for content boxes.

Of course, frames are always unpredictable, and have low compadability. It might be best to put a note in between iframe tags "Your browser does not recognize iframe. (get firefox ^_~)".


Hope that helps.
Logged
AKA Desimodontidae. If you're seeing this profile, Im probably at school.

If i were a clown, would you hold me when I'm down?/I wish I had someone to make me drown/So many people don't know that it's so damn hard to be a clown/I am the clown with the giant frown/My heart is in a state of being upside down...

Offline Osmose

  • So freakin' inactive
  • Royal
  • *
  • Posts: 3,041
(No subject)
« Reply #3 on: July 19, 2005, 02:08:10 AM »
Actually, his problem is simple.

Change this:
 
Quote


To this:
 
Quote


If it's still a bit offkilter after that, just tweak the iFrame X and Y to fit again and it will work.

Because the image is centered it will change dynamically with a resolution change to stay in the center of the user's screen. The iFrame, on the other hand, is in a static position, therefore not moving along with the centered picture.\


 
Quote
Changing resolution size changes picture sizes, no?


No it does not. Changing resolutions changes the size of your screen. An image that is 100x100 at a higher resolution will still be 100x100 at a lower resolution. The difference is that your screen will display all pixels bigger. Think of it as drawing a box around part of your current res and expanding that - the only thing changing is your view. Well, that and things like aligning that are dynamic to the resolution.

 
Quote

Also, when putting an iframe over an image, it might be best to use tables.


Again, no. iFrames are made specifically so they can be seperated from the rest of the screen. Fact is, if he had made the image the background of a table, a little fancy cell work could've removed the need for an iFrame at all, plus made the page easier to update and cleaner from a coding point of view. Of course, this would've required him to split the background image into a few images, but that's the tradeoff for the benefits - more work, more rewards.

Another side benefit of tables: If you have one of those fancy gradient bars, and you want to reduce filesize as well as be able to put text, like a title, on top of it, you can set the bar to being one pixel wide and as tall as you want. Putting it as the background of a table would stretch it to make it look the same as a wide version, with an infinately smaller filesize.
Logged
Hrm.

Offline AsakuraHao2004


  • RAM-TORTOISE!!
  • Exemplar
  • *
  • Posts: 1,623
  • AIM: dakutenshisdemon YIM: desimodontidae
(No subject)
« Reply #4 on: July 19, 2005, 02:21:58 AM »
Meh... I'm backed into a corner. I used sliced up photoshop images because I suck at mapping out a site manually, then throw an iframe where the content box is, switching the image to the background.

Whatever works for you I guess.
Logged
AKA Desimodontidae. If you're seeing this profile, Im probably at school.

If i were a clown, would you hold me when I'm down?/I wish I had someone to make me drown/So many people don't know that it's so damn hard to be a clown/I am the clown with the giant frown/My heart is in a state of being upside down...

Offline Zerlina

  • The Cloud that Rains on Your Parade
  • Exemplar
  • *
  • Posts: 1,871
(No subject)
« Reply #5 on: July 19, 2005, 02:34:39 AM »
Is there a way to have it centred while still keeping the iframe in the content spot?
Logged
Quote from: lucas_irineu
You look like my grandmother.
edit: when she was young. You don't look like you're 80.

Quote from: Dragonium
Last night I had a dream that Zerlina and I were pirates. It was... beautiful.

Offline Osmose

  • So freakin' inactive
  • Royal
  • *
  • Posts: 3,041
(No subject)
« Reply #6 on: July 19, 2005, 03:57:16 AM »
From what I know, I don't believe so. The only way would be to get the user's resolution(there's a simple way to get it through Javascript, I believe) and edit the X and Ys accordingly, but even that wouldn't be compatible with everything.

The only way I can think of is putting the entire page within another iFrame and then centering that, but I'm not sure if iFrames can be nested, or if it will work right if they can. It won't look that bad just because it's not centered.

Or you could use tables only, like I mentioned before.
Logged
Hrm.

Offline Zerlina

  • The Cloud that Rains on Your Parade
  • Exemplar
  • *
  • Posts: 1,871
(No subject)
« Reply #7 on: July 19, 2005, 05:28:45 PM »
Ok I fixed it. I just put the content on a popup so that it wouldn't matter if it was aligned to the left or centre.

Thanks for the help! :)
Logged
Quote from: lucas_irineu
You look like my grandmother.
edit: when she was young. You don't look like you're 80.

Quote from: Dragonium
Last night I had a dream that Zerlina and I were pirates. It was... beautiful.

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • HTML & DHTML (Moderator: De KoFfieŠ) »
  • Iframe positioning help
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum