A Digital Age Deserves A Digital Leader

resize webbrowser

resize webbrowser

Postby isus » Mon Oct 09, 2006 1:31 pm

can someone tell me the proper way to resize the web browser? I'm starting my portfolio site and I want to make it so that 1. if a users screen res is 800x600 use a specific style sheet and then > 800x600 use another one. 2. I want it so that when a user enters my website their browser changes to a specific size and does not allow them to resize it. I will probably want to do two different sizes depending on their screen resolution. I think that the code for the first problem is this:
Code: Select all
<head>
<script language="javascript">
<!--
if ((window.width >= 1024) && (window.height >= 768))
{
     <link rel="stylesheet" type="text/css" href="hires.css" />
}
else
{
     <link rel="stylesheet" type="text/css" href="lowres.css" />
}
-->
</script>
</head>


also is there a way to modify the above code so that you don't use an outside style sheet file?

thanks
PRO Level 4
Posts: 101
Joined: Wed Sep 06, 2006 8:33 pm
Location: USA, MI

Postby c0ldfyr3 » Mon Oct 09, 2006 2:08 pm

this is hte only way that i know how to make a window open and not be resizable....

this goes in your java script
Code: Select all
function wOpen() {
window.open('your url here','WindowNameHere','width=400,height=400,resizable=no');
}


this goes in your body
Code: Select all
body onload="javascript:wOpen()"

you need to add the <> tags
Last edited by c0ldfyr3 on Mon Oct 09, 2006 4:13 pm, edited 2 times in total.
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Postby isus » Mon Oct 09, 2006 3:32 pm

I think you are right. I used some code like this a long time ago but I did not have any use for it for quite some time. Now my site is going to be flash based so I will be playing with the browser sizing. thanks.
PRO Level 4
Posts: 101
Joined: Wed Sep 06, 2006 8:33 pm
Location: USA, MI

Postby c0ldfyr3 » Mon Oct 09, 2006 3:35 pm

i fixed the code so now its correct, not all bugged up!
Image
PRO Level 15
User avatar
Posts: 1346
Joined: Sun May 02, 2004 8:49 pm
Location: 127.0.0.1

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 5 guests