Alec said:
On the subject of iframes, as I cannot insert one with Frontpage 2000,
does anyone have a simple example of the code required.
I have a news page in my website which has an expiry date. It may seem a
little complex, but it works like a charm.
The only real problem is that the news has to be quoted in JS. I may work on
that. If you are interested in the code, let me know and if I suceed in
changing it, I'll post the changes.
Code follows
=========================================================================
CSS - Place in style.css
iframe.c1 {width:400px ; height:300px; display:none;}
HTML (on main page)
<!-- News -->
<button onclick="loadIframe('News','news.html')">Open/Close News</button>
<iframe class="c1" id="News" src=""></iframe>
<!-- ==== -->
news.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<!-- add print styles in here -->
<style type="text/css">
body {background: lightblue url("")}
</style>
<script type="text/javascript" src="scripts/news.js"></script>
</head>
<body onload="writenews()">
<span id="newstext"></span>
<br />
<input type="button" value="Print" onClick="print()">
</body>
</html>
JS - Place in news.js
// Update newsdate after changing writenews()
var newsdate = new Date('08 November 2005')
function Newsdate()
{
var ldate = newsdate.toLocaleString()
var fyear = newsdate.getFullYear()
return ldate.substring(0,ldate.lastIndexOf(fyear)+4)
}
// ----------------
function spc(no)
{
var text = ''
for (var i = 0 ; i < no ; i++ )
{text += ' '}
return text
}
// ----------------
function writenews()
{
var newsdata = (Math.ceil( (new Date() - newsdate) / (1000*60*60*24) ) <=
7)
? '<b>News from ' + top.document.title + '<br>'
+ 'Last Updated: <span class="red">' + Newsdate() + '</b></span>'
+ '<p>' +
// Enter New information here
// Retain opening ' and closing <br>'+ (' on last line)
// (NB spc(n) = n spaces. § is a section symbol.)
'§' + 'New Link in Family Websites (sidebar)<br>' +
spc(2) + 'Martin\'s Photos @ Fotopic.Net <br><br>' +
'§' + 'New Fotopic Gallery added <br>' +
spc(2) + 'and old gallery renamed'
// End of New information
: 'No news available'
newsdata += '</p>'
document.getElementById("newstext").innerHTML = newsdata
}
// ----------------
function loadIframe(frameName,sPath)
{
var x = document.getElementById(frameName)
if (!x.style.display | x.style.display == 'none')
{ x.src = sPath
x.style.display = 'block' }
else
x.style.display = 'none'
}
// ----------------
=========================================================================