Citat:
Ursprungligen postat av ooskar
finns säkert smidigare lösningar, men såhär gjorde jag iaf, och det fungerar rätt hyffsat. Dock måste besökaren ha fönstret maximerat om han ska se hela bilden.
PHP-kod:
<?php
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_res = $HTTP_COOKIE_VARS["users_resolution"];
else
{
?>
<script language="javascript">
<!--
writeCookie();
function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
location = 'index.php';
}
//-->
</script>
<?
}
?>
|
Aah tack!

fast som grabbarna säger ovan så är det ju inte skärmens storlek som man ska ha bilden efter, utan man ska ju anpassa efter webbläsarens fönster..