Web Development - Any Ideas?

Remove this Banner Ad

Robbo1

Senior List
Oct 31, 2001
198
0
Central Coast, NSW
I was just wandering if anyone knew if it is possible to force a web page to be a size e.g 800x600 in a browser. I'm not sure if this is possible but if anyone knows, it would be greatly appreciated.
 
Originally posted by Robbo1
I was just wandering if anyone knew if it is possible to force a web page to be a size e.g 800x600 in a browser. I'm not sure if this is possible but if anyone knows, it would be greatly appreciated.

I dont think thats possible. You can only really set a screen size, is on your own PC. Therefore a lot of people recommend a certain screen size to use on their page (ie. the page is best viewed at ...)


Is your boss away again? lol
 

Log in to remove this ad.

You can open up a new window at the size you want, but as far as I know there's no way to change the display resolution.

which is a bloody good thing, because I run 3200 x 1200!

What you can do, if you want to force the page to be within a 800-pixel width, for example.. is to put the whole thing in a table with width 800.
 
Originally posted by Robbo1


Do you have a 21" monitor or something (or bloody good eyesight)?

pooter.jpg


:D :D :D :D
 
oh, bloody hell... haha..

i wanted to do that split screen with my two monitors...
but, it prob turn out too dodgy..
one monitor being brand new, 17", the other a 14" one that changes from very bright to very dull... argh.. :p
 
Here's the one I use:

<SCRIPT language=javascript>
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'

win = window.open(mypage,myname,settings)
}
</SCRIPT>

That is the script. The link that you are using will look like this:

<B>
<a href="http://www.geocities.com/dons_fanzine/yr2001a.html" onclick="NewWindow(this.href,'fixture2001','640','480','yes');return false" style="font-size: 8pt">here</a></B></font>

This script also automatically centers the page that you open. Hope you like it. ;)
 
Originally posted by Robbo1
I was just wandering if anyone knew if it is possible to force a web page to be a size e.g 800x600 in a browser. I'm not sure if this is possible but if anyone knows, it would be greatly appreciated.

i know it IS possible...my mate did it...but im not sure how he did it
 
Actually Robbo, try this one as well. It's in DHTML

Place this in the <head> tags

<script>

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
if (ie5)
document.getElementById("saver").style.display=''

tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.onmousemove=drag_drop
}

function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width
document.getElementById("dwindow").style.height=initialheight=height
document.getElementById("dwindow").style.left=30
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30 : document.body.scrollTop*1+30
document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20 : document.body.clientWidth
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20 : document.body.clientHeight
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset : document.body.scrollLeft
document.getElementById("dwindow").style.top=ns6? window.pageYOffset : document.body.scrollTop
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

if (ie5||ns6)
document.onmouseup=new Function("dragapproved=false;document.onmousemove=null;document.getElementById('saver').style.display='none'")

</script>

And this is the link bit in the Body:


<div id="dwindow" style="position:absolute;background-color:navy;cursor:hand;left:0;top:0;display:none" onMousedown="initializedrag(event)" onSelectStart="return false">
<div align="right"><img src="max.gif" id="maxname" onClick="maximize()"><img src="close.gif" onClick="closeit()"></div>
<iframe id="cframe" src="" width=100% height=100%></iframe>
<div id="saver" style="width:100%;height:100%;position:absolute;left:0;top:0;display:none"></div>
</div>

<script>
// Note: Use below code to load DHTML Window as page loads
if (ns6) window.onload=new Function('loadwindow("http://www.geocities.com",800,600)')
else
loadwindow("http://www.geocities.com",800,600)
</script>
<a href="javascript:loadwindow('http://www.geocities.com',800,600)">Geocities</a>
 
How about just useing the table tag to set it to what ever you need!

<table width=800> (or whatever size!)

IF you set it to: <table width=100%> then that just fills up the page! IF you choose to set it by pixels, then it only use the amount that you set!
 

(Log in to remove this ad.)

Originally posted by CJ
How about just useing the table tag to set it to what ever you need!

<table width=800> (or whatever size!)

IF you set it to: <table width=100%> then that just fills up the page! IF you choose to set it by pixels, then it only use the amount that you set!


But that wouldn't force the browser window to stay at 800x600. Only the tables dimensions, not the actual IE or NS window.
 
Originally posted by M29



But that wouldn't force the browser window to stay at 800x600. Only the tables dimensions, not the actual IE or NS window.

Yeah your right!

I just misunderstood what was being asked!
 
Originally posted by CJ


Yeah your right!

I just misunderstood what was being asked!

Actually, you did also suggest something as well. If he wants the window to have no scroll bars, he is best to use the table tag set to 600 pixels wide. If you get what I mean.
 
Originally posted by M29


Actually, you did also suggest something as well. If he wants the window to have no scroll bars, he is best to use the table tag set to 600 pixels wide. If you get what I mean.

M29, I know what you mean. Thats what I thought he was asking!
 

Remove this Banner Ad

Back
Top