Forum Moderators: open
While I don't EVER pretend to be brilliant at any of this, I HAVE been writing html and using various scripts and languages since about 1990 (though I'm WAY behind really, since I had to go back to work full-time after 20 years "retired", and now I don't have the time to keep up on things). I can't seem to get rcjordan's apparently nice n simple little script to make any sense, so obviously I'm missing a GOB of stuff. Stuff like: do I need to specify EACH image as var image1, var image2, etc? Shouldn't I need to specify image height somehow, as well as image width? Do I need to put the image pixel-size in "var image1 = '<img src="*.jpg" width="' + image1_width + '">';"? Does this script go in the <head> or the <body>? Does this script go on each page with the pics which one wishes to resize, or on the referring page which redirects the individual's browser to the appropriate page for the browser's resolution? My first assumption when I saw the script was that you simply added it to the referrer page, but the more I looked at it, the less "simple" it seemed....
I'm feeling fairly "simple" myself right now (and I'll no doubt feel totally stupid when one of you points out how simple this REALLY is....) anyway, thanks in advance for any assistance anyone can provide with this.
"...do I need to specify EACH image as var image1, var image2, etc?..."
"...Shouldn't I need to specify image height somehow, as well as image width? ..."
"...Do I need to put the image pixel-size in "var image1 = '<img src="*.jpg" width="' + image1_width + '">';"? ..."
"...Does this script go in the <head> or the <body>? ..."
var image2 = '<img src="logo2.gif" width="' + image1_width + '">';
document.write(image2);
(Once you build up some skills, you'd probably make improvements, like and define a function in a separate .js file.)
"...Does this script go on each page with the pics which one wishes to resize, or on the referring page which redirects the individual's browser to the appropriate page for the browser's resolution? ..."
One each page with the pics.
Shawn
I searched on "resize graphics", got 16 results, read each of them through and of course none of them addressed what I was wanting help with. Hence my post of a new topic....
Now, as to the info you so kindly provide, Shawn.... I do hope I'm getting this right, because it seems INFINITELY more complicated that I thought something like this would be. I will obviously play with it tomorrow, and hopefully be bright enough to take what you've given me and get it somewhere close to "right". I'm not sanguine, as you can probably tell....
*shrug* Defining a function? Not until I can quit my day job.... The only programming I do is MUSH softcode....
Anyway, thanks again, guys.
[Um. Anyone have any idea how to "look" at a site at 640x480 when one's monitor/display adaptor doesn't offer a res that low? So far the only idea I've come up with is to set the res on my laptop down that far and see what I can do working back and forth between machines....]
"...I searched ..."
Oh, dear, it seems you misunderstood me too. I didn't mean you shouldn't have posted; I just meant that in the future, others might have the same question.
"...it seems INFINITELY more complicated ... I'm not sanguine..."
It is really easy, honest. I hope my post did not make it sound more complex; that was not the intent. Hope you feel fresher in the morning. There are also some guides to getting started here: [webmasterworld.com...]
Shawn
how to "look" at a site at 640x480
Well, it's actually much easier than changing the resolution :)
Create a document with the links below. Bookmark each link. Whenever you need to view your site in a different resolution, just "open" the bookmark, and it will resize the browser window for you.
<a href="javascript:window.resizeTo(640,480)">640×480</a>
<a href="javascript:window.resizeTo(800,600)">800×600</a>
<a href="javascript:window.resizeTo(1024,768)">1024×768</a>
<a href="javascript:window.resizeTo(1280,1024)">1280×1024</a>
<a href="javascript:window.resizeTo(1600,1200)">1600×1200</a>
i recently came across this prob with my bottom menu
here's how i got around it, may not be the best solution but it works.
I think this is what you may have been looking for?
With the resolutions I'm catering for here I could also add a height change (still might on high res)
<SCRIPT language=JavaScript>
//ooh lovely another javascript :)
//this is to change the bottom right graphic depending on screen res the user is running
//called on load only
function getuserres() {
var userwidth = screen.width
var userheight = screen.height
var reswidthandheight = userwidth + userheight
switch(reswidthandheight) {
case 1792: return "bot_files/bottom_right_end1.gif"; //1024 768
case 2016: return "bot_files/bottom_right_end2.gif"; //1152 864
case 2000: return "bot_files/bottom_right_end3.gif"; //1280 720
case 2048: return "bot_files/bottom_right_end4.gif"; //1280 768
case 2240: return "bot_files/bottom_right_end5.gif"; //1280 960
case 2304: return "bot_files/bottom_right_end6.gif"; //1280 1024
default: return "bot_files/bottom_right_end1.gif"; //1024 768
}
}
//get the user res and display
//document.images["userres"].src=(respic);
//our number is always going to be 26 char if its 1 or 2 or > 3 then set button width accordingly
function loaduserrespic() {
var respic = getuserres();
var sButtonWidth
var iButtonWidth
document.images["userres"].src=(respic);
sButtonWidth = respic.charAt(26)
//alert('our returned char sButtonWidth is '+sButtonWidth);
if (sButtonWidth == 1)
{
iButtonWidth = 110
for (i=1; i<8; i++)
{
document.images["nav0" + i].width=iButtonWidth;
//alert(document.images["nav0" + i].width=iButtonWidth);
}
}
if (sButtonWidth == 2)
{
iButtonWidth = 128
for (i=1; i<8; i++)
{
document.images["nav0" + i].width=iButtonWidth;
//alert(document.images["nav0" + i].width=iButtonWidth);
}
}
if (sButtonWidth >= 3)
{
iButtonWidth = 146
for (i=1; i<8; i++)
{
document.images["nav0" + i].width=iButtonWidth;
//alert(document.images["nav0" + i].width=iButtonWidth);
}
}
}
</SCRIPT>
in body onload=loaduserrespic()
I was also showing a pic on the bottom right to show res, just a gimmick but it all adds to the style ;)
this cycles through 7 buttons, the name of the buttons is nav0x where x will be replaced through the loop
you wont need all the code but hope this helps ;)
L8r
SLoB
Thanks VERY much. I will try this and see which option seems to work best; I probably won't have the time again to do anything with it all until the weekend but I'll post an update as soon as I know anything - assuming I EVER know anything!
That's one thing I've noticed about this site as opposed to others from which I've attempted to request help: you folks are polite and as helpful as you can be considering the odd things people like me seem to ask. It's truly truly appreciated....