Make Webpage Resize Automatically to Visitor's Resolution??

  • LiveG
  • Novice
  • Novice
  • User avatar
  • Posts: 27
  • Loc: London

Post 3+ Months Ago

Hi there guys,

I have designed a "hybrid" (half flash/html) site.
I would like to know if it is possible to make pages in my site resize to suite the visitors' monitor resolution.

For example, I'm using my computer with 1024x768 resolution.
If I change my resolution to 800x600 I want my site to resize to fit the screen resolution of 800x600.

I hope I'm making sense :? Can anyone help?
Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I don't think anything but IE supports it, and I HIGHLY advise against doing it as it pisses people off, but here's some javascript that will resize the window to the visitors res.
Code: [ Select ]
<script language="javascript">
    X = screen.width;
    Y = screen.height;
    window.moveTo(0,0);
    window.resizeTo(X,Y)
</script>
  1. <script language="javascript">
  2.     X = screen.width;
  3.     Y = screen.height;
  4.     window.moveTo(0,0);
  5.     window.resizeTo(X,Y)
  6. </script>
  • LiveG
  • Novice
  • Novice
  • User avatar
  • Posts: 27
  • Loc: London

Post 3+ Months Ago

so, its a bit of a double edged sword? hmmm :o

ok, I'll give it a try though cause I've always wanted to see the effect. I'll decide what to do with it after. :arrow: I'll let you know if it works

Thanks
  • cerio
  • Proficient
  • Proficient
  • User avatar
  • Posts: 263
  • Loc: UK

Post 3+ Months Ago

....I HIGHLY advise against doing it as it pisses people off.....


Oh boy, are they right! I get SO pissed off when a site does that. *I* choose what size I view at, no-one else.
  • LiveG
  • Novice
  • Novice
  • User avatar
  • Posts: 27
  • Loc: London

Post 3+ Months Ago

Hi there,

I tried to put that code in, but its not working.
Could you tell me where I how and where I should put it?

PS: I'm using Dreamweaver MX
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

cerio wrote:
Oh boy, are they right! I get SO pissed off when a site does that. *I* choose what size I view at, no-one else.


Yeah, I think that's what he's trying to do. Resize the site to the size of the browser, so that YOU can resize the browser to the size you wanna view at.

If it's set at a fixed width, which I'm guessing is what's already there, then you have NO choice.

Just use tables to get it going, then you can work on more advanced methods..

Code: [ Select ]
<table width="100%"><tr><td>content goes here</td></tr></table>

That's it in its simplest form... With nested tables, and cell background images, etc. You can do much more..

Click the Reptile Rooms link in my sig, and you can see there how the page resizes to fit the browser window using just tables.
  • LiveG
  • Novice
  • Novice
  • User avatar
  • Posts: 27
  • Loc: London

Post 3+ Months Ago

Hi, I clicked on your reptilerooms link in your sig and the page doesn't resize like what I'm thinking:

Heres what I want to do. Go here and resize their browser:

http://www.naruto.com

As you can see these guys have also done a hybrid site like mine (half flash/html) and when u make the browser smaller the >whole site<shrinks.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Oh, you actually wanna scale the content... ermm... yeah, that does piss people off :D
  • LazyJim
  • Student
  • Student
  • LazyJim
  • Posts: 92

Post 3+ Months Ago

If it was made in ALL FLASH then you send the visitors to the .swf file, it automatically scales to fit the window.

But ALL FLASH is a bad idea too!
  • Kraze
  • Newbie
  • Newbie
  • Kraze
  • Posts: 8
  • Loc: New Orleans, LA

Post 3+ Months Ago

I have to agree that I hate when a web site resizes automatically to my resolution, mainly because I run my monitor at 1600x1200.

Though after looking at that site it seems all you want is to rescale your content based on a browser reload.

I'm not sure how to make Flash resize your content, but you can use either of the following to reload the page in html, if your page is programmed properly then using this will resize your page

Code: [ Select ]
<SCRIPT LANGUAGE="JavaScript1.2">

  function reDo(){ window.location.reload() }
  window.onresize = reDo;

</SCRIPT>
  1. <SCRIPT LANGUAGE="JavaScript1.2">
  2.   function reDo(){ window.location.reload() }
  3.   window.onresize = reDo;
  4. </SCRIPT>
or
Code: [ Select ]
<BODY onResize="window.location.reload()">
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

LOL, ok this may be easier than I thought. I've used the source of the link you provided as an explaination.

Code: [ Select ]
When you publish your page open it in notepad, you will see somthing like this

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="100%" HEIGHT="100%" id="naruto_net" ALIGN="">
<PARAM NAME=movie VALUE="naruto_net.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#D2320A> <EMBED src="naruto_net.swf" quality=high bgcolor=#D2320A WIDTH="100%" HEIGHT="100%" NAME="naruto_net" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>

What you need to do to achieve the effect the link you gave does is make sure the anything within the <OBJECT></OBJECT> && <EMBED></EMBED> that says WIDTH="blah" or HEIGHT="blah" looks like the ones here, WIDTH="100%" HEIGHT="100%"
The flash player/browser sees that and knows to scale the movie to be whatever the browsers width & height are. Since the allowScale fsCommand is true by default, unless someone has set it otherwise in the flash movie its self the movie will resize on its own.
  1. When you publish your page open it in notepad, you will see somthing like this
  2. <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  3. codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
  4. WIDTH="100%" HEIGHT="100%" id="naruto_net" ALIGN="">
  5. <PARAM NAME=movie VALUE="naruto_net.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#D2320A> <EMBED src="naruto_net.swf" quality=high bgcolor=#D2320A WIDTH="100%" HEIGHT="100%" NAME="naruto_net" ALIGN=""
  6. TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
  7. </OBJECT>
  8. What you need to do to achieve the effect the link you gave does is make sure the anything within the <OBJECT></OBJECT> && <EMBED></EMBED> that says WIDTH="blah" or HEIGHT="blah" looks like the ones here, WIDTH="100%" HEIGHT="100%"
  9. The flash player/browser sees that and knows to scale the movie to be whatever the browsers width & height are. Since the allowScale fsCommand is true by default, unless someone has set it otherwise in the flash movie its self the movie will resize on its own.
  • LazyJim
  • Student
  • Student
  • LazyJim
  • Posts: 92

Post 3+ Months Ago

That's what I was saying - Flash moovies resize all by themselves!

i just didn't know how to embed them.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

LazyJim wrote:
,it automatically scales to fit the window.


Indeed you did, I diddn't see that before.
Sorry for steping on your toes Jim, I was focusing on Gs' replies earlier.
  • LazyJim
  • Student
  • Student
  • LazyJim
  • Posts: 92

Post 3+ Months Ago

oh no problem stepping on my toes, I've got pleanty of toes!

(actually just hearing someone else know the simple fact brings me hope for the rest f the web! shame it's flash though :( )
  • sputnik
  • Novice
  • Novice
  • sputnik
  • Posts: 21

Post 3+ Months Ago

Im having the same problem as well. My site uses tables nested and all and eveything was working fine you could view my site at any resolution and the left to right scroll bar never appeard it would scale to fit the resolution of the viewer but when I started importing blocks and inserting google ads and other stuff something happend it started to get where the left right scroll bar appeared whenever you viewed under really high resolution . I cant figure out why. I even tried to make another page Im creating one main table telling it to be 97% wide and inserting tables inside that main table and still the damned thing spans too wide when you view it on the lower resolutions . Ive seen many sites before that the pages scales to fit but i cant figure out how to make mine do it. Im telling the talbes to take up a percentage and all .

does anyone know how to adress this issue?


If you look at my page: http://sputnikradio.com in different resolutions you will see what im talking about.

Can anyone tell me how to fix it ?


If you look at http://funender.com you will see his page scales to fit I cant figure out why mine will not.
  • sputnik
  • Novice
  • Novice
  • sputnik
  • Posts: 21

Post 3+ Months Ago

So does anyone know how i can fix it to where my tables scale to the resolution without spanning out far right?
  • sputnik
  • Novice
  • Novice
  • sputnik
  • Posts: 21

Post 3+ Months Ago

so i guess yall don't know hunh?
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

I suffer from tablephobia ... and so don't know much about them.

But an educated guess would tell me it is the adsense ads that are to blame. They have certain dimensions ... for example
one on your page has a width of 234 pixels, another one at 250 pixels.

Because their widths are "fixed" there will come a point, when the window size is decreased, that there is no "stretchiness" left ... if you get my drift?

Had these ad units themselves been liquid-like too, then you would not have this problem.

Add to this other fixed width elements like images and search boxes and
the problem is made worse.


So there is little you can do.
Only changing the design totally will give you more fluidity .... but even then you will still reach a point where this happens.

As long as it displays at 1024 pixels wide you are mostly ok these days.

Post Information

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