Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

HTML Variables?

(Click here to view the original thread with full colors/images)


Posted by: Canis Lupus

Hmm, usually this can be done using server-side scripting (perl or vbasic) that can try to do a browser resolution check, but I dunno if it can directly affect and change the resolution of a java applet. If it were possible at all, it would have to be set within the applet's variables.

lemme see wat I can dig up, and I'll let you know (I haven't really tried it before - you'll probably have more luck with a Flash animation rather than a java applet)...

------------------
Those who expect nothing will never be disappointed...



Posted by: Scav

I dont know the answer but i would just like to say holy $*#( yak now there are 4 people to post on this board. 8)



Posted by: Yakbak

Ok, I need to know how to set up an HTML page whre it can scan your browser resolution in some way, and set a screen resolution of a java applet on the same page corresponding to your current desktop/browser res? If u need me to be more specific, just post again.

http://www.opentechsupport.net/forums/biggrin.gif



Posted by: Yakbak

lol
http://www.opentechsupport.net/forums/biggrin.gif



Posted by: Kerash

You Probly can, but i doubt it.
Some systems don't Support all Resolutions. Meaning, if You set it to change to a 1024x768 Resolution, i could veiw it with a 386, and then call my lawyer cause you just ruined my machine

^ Why browsers dont' support changes to Resolution in, Basicly anyway, Though i could be extremely wrong, You never know

------------------
Need Extra Help? http://www.kerash.org



Posted by:

hmm... I had a quick look on one of my old haunts and found script for redirecting people to pages determined by screen res. Of course , you would want to rezise the images and text to look right in each rez.

<!-- THREE STEPS TO INSTALL RESOLUTION PAGE:

1. Paste the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document
3. Be sure to update the resolution pages to ones on your site -->

<!-- STEP ONE: Copy this code into the BODY of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function redirectPage() {
var url640x480 = "http://www.yoursite.com/640x480";
var url800x600 = "http://www.yoursite.com/800x600";
var url1024x768 = "http://www.yoursite.com/1024x768";
if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;
else if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url640x480;
}
// End -->
</script>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<center>
<form>
<input type=button value="Enter!" onClick="redirectPage()">
</form>
</center>

<!-- STEP THREE: Don't forget to update the URLs in the code above! -->

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.29 KB -->

I hope that helps you. Also , there is another script available to make image sizes relative to the users screen rez. You can find more useful scripts and such at :
http://javascript.internet.com/

Enjoy !
Chile =)



Posted by: Kerash

Kinky

------------------
Who am i? Anybody?

Exactly



Posted by: Canis Lupus

Nice code Chile, but it doesn't exactly answer Yak's question, because, while that code may detect the browser window resolution and resize the page accordingly, it would not affect the properties of a java applet within that window.

The java applet usually has its size specified in its own variables, separate from the browser or any coding done within the <head> tag ... so it would be a tad more complex to have the applet actively resize itself depending on the browser window.

The simplest solution (which I don't think is the only solution) is to create more than one instance of that java applet, with varying sizes in its variables depending on the type of resolution you wanna support, and just do a simple javascript browser detect and redirect depending on the browser resolution, and just have cookies in place so that visitors who return will automatically be redirected to their matching screen resolution instead of having to do the whole browser detect/redirect again...

Use Chile's link to look for that script, hehhee..

------------------
Those who expect nothing will never be disappointed...



 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.