Forums

This topic is locked

Keeping content at the bottom of the page.

Posted 01 Nov 2007 14:27:27
1
has voted
01 Nov 2007 14:27:27 Kieran Pearce posted:
I am teaching myself how to use dreamweaver at the moment and i was wondering if anyone could tell me how to force a layer to remain at the bottom of the page. I need to have some copyright information on everypage and having the information in a layer of its own is proving a problem on pages with a lot of content. If anybody knows of a setting or code to force this copyright to the bottom of the screen i would be very greatful.

Many Thanks,
Kieran Pearce
ICT Techncian

Replies

Replied 01 Nov 2007 18:58:15
01 Nov 2007 18:58:15 john newsome replied:
This might help it places the copyright at the bottom of the window what ever the size
get_resolution.php
<pre id=code><font face=courier size=2 id=code> &lt;?
/**************************************************************************************
Originally from www.phpbuddy.com/article.php?id=8
Author: Ranjit Kumar (Cheif Editor phpbuddy.com)
Modified by: Ying Zhang (Dodo) pure-essence.net
Two main modifications:
1. To check currently saved screen resolution cookie
2. To allow inclusion by other php files

In order to use this file in another php file, use:

$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php";
echo $screen_width." is your screen width and ".$screen_height." is your screen height.";

*****************************************************************************************/
?&gt;

&lt;script language="javascript"&gt;
&lt;!--
function getHight(){
if (window.innerHeight) {
theHeight=window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
theHeight=document.documentElement.clientHeight;
}
else if (document.body) {
theHeight=document.body.clientHeight;
}
return theHeight;
}

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_res="+ screen.width +"x"+ getHight();
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie
if (document.cookie){
location = '&lt;?=$GLOBALS[callget_res_page_name]?&gt;';
}

}


function checkRes(width, height) {
if(width != screen.width || height != getHight()) {
writeCookie();
} else {
return true;
}
}
//--&gt;
&lt;/script&gt;

&lt;?
if(isset($HTTP_COOKIE_VARS["users_res"])) {
$screen_res = $HTTP_COOKIE_VARS["users_res"];
$screen_res_tmp = explode("x", $screen_res);
$screen_width = $screen_res_tmp[0];
$screen_height = $screen_res_tmp[1];
?&gt;
&lt;script language="javascript"&gt;
&lt;!--
checkRes(&lt;?=$screen_width?&gt;, &lt;?=$screen_height?&gt<img src=../images/fwzone/forum/icon_smile_wink.gif border=0 align=middle>;
//--&gt;
&lt;/script&gt;
&lt;?
}
else //means cookie is not found set it using Javascript
{
?&gt;
&lt;script language="javascript"&gt;
&lt;!--
writeCookie();
//--&gt;
&lt;/script&gt;
&lt;?
}
?&gt;</font id=code></pre id=code>

HTML

<pre id=code><font face=courier size=2 id=code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;


&lt;script language="Javascript"&gt;
var sURL = unescape(window.location.pathname);
function refresh()
{
window.location.href = sURL;
}

&lt;/script&gt;
&lt;?php
$callget_res_page_name = $REQUEST_URI;
$GLOBALS[callget_res_page_name] = $callget_res_page_name;
include("get_resolution.php";
?&gt;
&lt;/head&gt;

&lt;body onResize="refresh()"&gt;
&lt;div id="bottom" style="position:absolute; top:&lt;?=$screen_height-20;?&gt;px"&gt;&copy; &lt;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt; </font id=code></pre id=code>
Replied 13 Nov 2007 17:55:33
13 Nov 2007 17:55:33 Kieran Pearce replied:
I tried using this code and apart from producing a layer with "©&lt;&gt;" nothing seemed to happen. Is there anything i need to do to the code to make this layer stay at the bottom of the screen?

Reply to this topic