View Full Version : Redirection
Ice_Man
06-04-2006, 11:35 AM
Hi All,
i'm currently having an issue with redirection i have found a dynamic drive script that will redirect he user depending on the screen size but my question is, is there a way to modify the page dependant on the users screen res or do i need to create a new site/s using different screen res's eg
www.domain.com/800*600
www.domain.com/1024*768
or can i change the size of the page using a script eg have a site www.domain.com and have the page sit the screen automaticly weather it be 1024*768 or 800*600
Found something that may very well be what your looking for.
See: http://www.echoecho.com/toolscreenresolutionredirect.htm
I don't know what script your using from DD but they also have this one: http://www.dynamicdrive.com/dynamicindex9/info3.htm
Looks simple enough - think I would use that one. :cool:
Oh yea, run a search on www.yahoo.com or www.google.com with quotes for - "redirect script" and you'll find a bunch of goodies.
is there a way to modify the page dependant on the users screen resIf you design a page properly, using relative units, the browser will do this for you.
djr33
06-04-2006, 09:15 PM
The only things that don't scale well are graphics, and even some of those can be made to work.
You should just design your site so it looks good at all resolutions; make it fit within 800, but also scale up well, or have a nice border around it.
Make you site 800 wide (actually 779, seems right to fit, with scrollbars and such), and have a cool background outside that, so it looks alright at bigger rez.
Preferably, do what Twey says, but if not possible, just make it not look horrible with the "extra space" around it, as I said above.
mwinter
06-07-2006, 06:07 PM
Presumably the OP is in a similar boat the poster in another recent thread (http://www.dynamicdrive.com/forums/showthread.php?p=39152#post39152).
Mike
aharvey
08-13-2007, 08:39 PM
Greetings,
I surely see the problems with redirecting to different pages based on screen size, but I'm also uncomfortably aware of the problems associated with viewing graphics on wildly different-sized screens. How difficult would it be to use screen size info to change image size definitions instead of redirecting to entirely different pages?
Alan
It's not that difficult -- see the logo in the corner of my home page (http://www.twey.co.uk/). The problem is designing the images so that they don't look too bad if stretched or squashed within reasonable bounds, since there's no way in CSS to specify that an element should maintain a proportion between its height and width.
aharvey
08-13-2007, 09:04 PM
Twey,
Well therein lies the rub. The images in question are for the most part photographs that really can't get stretched or squashed. That's partly why a simple binary decision (i.e., big image size or small) based on screen size seems more practical than a liquid layout approach responding to window size. I'm not sure, however, that you can calculate the size of an image using javascript. Dang!
You can, but if you're using Javascript anyway you may as well just use it to make sure that the height of the image is kept proportional to its width.
functon Point(x, y) {
this.x = x;
this.y = y;
}
function Rectangle(tl, br) {
this.tl = tl;
this.br = br;
}
Rectangle.prototype = {
'width' : function() {
return this.br.x - this.tl.x;
},
'height' : function() {
return this.br.y - this.tl.y;
}
};
Rectangle.fromImage = function(imgurl) {
var im = new Image(imgurl);
return new Rectangle(new Point(0, 0), new Point(im.width, im.height));
};
Rectangle.fromElement = function(el) {
// Mostly from QuirksMode.
var curleft = 0,
curtop = 0,
oel = el;
if (el.offsetParent) {
curleft = el.offsetLeft;
curtop = el.offsetTop;
while(el = el.offsetParent) {
curleft += el.offsetLeft;
curtop += el.offsetTop;
}
}
return new Rectangle(new Point(curleft, curtop), new Point(curleft + oel.offsetWidth, curtop + oel.offsetHeight));
};
techno_race
09-04-2007, 03:11 AM
<img width="...%" src="...">
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.