vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Screen Resolution Script (https://vborg.vbsupport.ru/showthread.php?t=39739)

dano 07-14-2003 05:59 PM

^

N!ck 07-14-2003 06:30 PM

Code:

<script language="JavaScript">
if (screen.width==640) {
  document.write('Resolution is 640x480.');
} else if (screen.width==800) {
  document.write('Resolution is 800x600.');
} else if (screen.width==1024) {
  document.write('Resolution is 1024x768.');
} else {
  document.write('Resolution is greater than 1024x768');
}
</script>

Just off the top of my head; I haven't seen any of those search results.

Lesane 07-14-2003 06:54 PM

Or you could do this, for different banners:

PHP Code:

<SCRIPT LANGUAGE="JavaScript">

<!-- 
Begin
function redirectPage() {
var 
url640x480 "http://www.yoururl.com/urlwithbanner640_480.html";
var 
url800x600 "http://www.yoururl.com/urlwithbanner800_600.html";
var 
url1024x768 "http://www.yoururl.com/urlwithbanner1024_768.html";
var 
url1280x1024 "http://www.yoururl.com/urlwithbanner1280_1024.html";
if ((
screen.width == 640) && (screen.height == 480)) 
window.location.hrefurl640x480;
else if ((
screen.width == 800) && (screen.height == 600))
window.location.hrefurl800x600;
else if ((
screen.width == 1024) && (screen.height == 768))
window.location.hrefurl1024x768;
else if ((
screen.width == 1280) && (screen.height == 1024))
window.location.hrefurl1280x1024;
else 
window.location.hrefurl640x480;
}
// End -->
</script>
</
head>
<
body onload="redirectPage()"


corsacrazy 07-14-2003 06:56 PM

this

code:
<script language="JavaScript">
if (screen.width) {
if (screen.width==640) {
document.write('Resolution is 640x480.');
} elseif (screen.width==800) {
document.write('Resolution is 800x600.');
} elseif (screen.width==1024) {
document.write('Resolution is 1024x768.');
} else {
document.write('Resolution is greater than 1024x768');
}
} else {
document.write('Not using Internet Explorer; can't detect resolution.');
}
</script>


didnt werk :( it sed Expected ;

N!ck 07-15-2003 12:04 AM

Ehhh...try again... Should work now. :rolleyes:

BTW, Lesane, I was just trying to show how to detect the screen resolution because there are hundreds of things he could want to do with this script...I wanted to provide something that was nice and customizable, and I feel like you just repeated what I already said (but worse). It's not nice. I wouldn't be bothered, but you've been an @$$4073 to me in the past, so I can't help but feel like you're just trying to get attention (a "thank you" even) at my expense.

Also, I've never heard of a screen resolution where height divided by width is not equal to 75%, so those parts in your conditionals are unnecessary.

Good day.


All times are GMT. The time now is 05:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01088 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete