letitia
Feb 19th 2007, 1:07 pm
I am new to this forum so sorry if this has already beeen covered but I couldn't find anything that helped when I searched.
I am know actionscript but not js. I am building a site in flash where there are 2 different versions of the site for large and small screen sizes and I am using the following javascript to detect the screen resolution and then show the approprate site. But it won't work! I have never needed to ask anything before but this really has me stumped, any help at all would be appreciated and I would offer any help that I can provide with actionscript in return. sorry for being so dumb...
<script type="text/javascript">
// <![CDATA[
var w = screen.width;
var h = screen.height;
if(w == 800 && h == 600){
location = 'home_small.html';
}else if(w == 1024 && h == 768){
location = 'home_small.html';
}else if(w == 1280 && h == 1024){
location = 'home.html';
}else if(w == 1600 && h == 1200){
location = 'home.html';
}
</script>
I also tried using greater and smaller than so that I dont need to list each screen size individually, but no luck...
:)
I am know actionscript but not js. I am building a site in flash where there are 2 different versions of the site for large and small screen sizes and I am using the following javascript to detect the screen resolution and then show the approprate site. But it won't work! I have never needed to ask anything before but this really has me stumped, any help at all would be appreciated and I would offer any help that I can provide with actionscript in return. sorry for being so dumb...
<script type="text/javascript">
// <![CDATA[
var w = screen.width;
var h = screen.height;
if(w == 800 && h == 600){
location = 'home_small.html';
}else if(w == 1024 && h == 768){
location = 'home_small.html';
}else if(w == 1280 && h == 1024){
location = 'home.html';
}else if(w == 1600 && h == 1200){
location = 'home.html';
}
</script>
I also tried using greater and smaller than so that I dont need to list each screen size individually, but no luck...
:)