Резолюция на монитора ...

C++ JAVA
Post Reply
User avatar
BattleGrounds
Гуру
Гуру
Posts: 2473
Joined: Wed Sep 19, 2007 5:30 pm
Answers: 37

Резолюция на монитора ...

Post by BattleGrounds » Tue Feb 03, 2009 4:46 pm

Как мога да разбера ако някой влезе в сайта и е с рецолюция 1024х768

raiden
Гуру
Гуру
Posts: 2182
Joined: Fri Dec 08, 2006 8:13 am
Answers: 190
Location: Варна

Post by raiden » Tue Feb 03, 2009 4:50 pm

Web Developer Toolbar-а има функция за resize

Edit: Помислих че друго питаш, сега ще изровя 1 скрипт за това което искаш

User avatar
emagi
Шаман
Шаман
Posts: 6476
Joined: Fri Dec 07, 2007 3:24 pm
Answers: 1032

Post by emagi » Tue Feb 03, 2009 4:52 pm

Чрез Javascript става най-лесно!Какво точно ти трябва?

User avatar
StormBreaker
Шаман
Шаман
Posts: 5210
Joined: Mon Mar 05, 2007 8:08 pm
Answers: 344

Post by StormBreaker » Tue Feb 03, 2009 4:52 pm

Javascript:
if ( (screen.width == 1024) && (screen.height == 768) )
{
Със резолюция 1024x768 е
}
С php няма как да стане.

raiden
Гуру
Гуру
Posts: 2182
Joined: Fri Dec 08, 2006 8:13 am
Answers: 190
Location: Варна

Post by raiden » Tue Feb 03, 2009 4:58 pm

Code: Select all

<?
if&#40;!$_COOKIE&#91;"res"&#93;&#41; &#123;
?>
<script language="javascript">
<!--
wCookie&#40;&#41;;

function wCookie&#40;&#41; 
&#123;
 var today = new Date&#40;&#41;;
 var the_date = new Date&#40;"December 31, 2023"&#41;;
 var the_cookie_date = the_date.toGMTString&#40;&#41;;
 var the_cookie = "res="+ screen.width +"x"+ screen.height;
 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
 document.cookie=the_cookie
&#125;
//-->
</script>
<?
&#125;
?>
И вече си я извеждаш с $_COOKIE["res"], можеш да я explode на x-а на широчина и дължина

User avatar
BattleGrounds
Гуру
Гуру
Posts: 2473
Joined: Wed Sep 19, 2007 5:30 pm
Answers: 37

Post by BattleGrounds » Tue Feb 03, 2009 5:30 pm

Благодаря много

Post Reply