Dette er javascriptet:
<SCRIPT LANGUAGE="JavaScript">
function verScroll(dir, spd, loop) {
loop = true;
direction = "up";
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval("document.getElementById('contentLayer').style");
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
}
}
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == "dn") {
page.top = (y_pos - (speed));
} else {
if (direction == "up" && y_pos < 10) {
page.top = (y_pos + (speed));
} else {
if (direction == "top") {
page.top = 10;
}
}
}
scrolltimer = setTimeout("verScroll(direction,speed)", 1);
}
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
// End -->
</script>
Og denne table kører javascriptet op og ned, ikke de andre der kommr
efter asp udregningerne.
<%
set rsOldnews = connect.execute("select id, bild, bildtext, rubrik,
ingress, datum, forfattare, eforfattare, nyheter from nyheter where
visa=1 order by datum desc")
set rsantal = connect.execute ("select iantal from antal")
intAntal=rsantal("iantal")
antal=0
do until rsoldnews.eof or antal = intantal
%>
<div align="right">
<table width="250" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/tabletopny.jpg">
</td></tr>
<tr><td><table id="id16">
<tr><td width="70%">
<font size="1"color="#ffffff"><div id="id16" padding="0"
margin="0"></p><% =rsOldnews("Rubrik") %><br>Postet:
<% =FormatDateTime(rsOldnews("Datum"),2) %>
<br>
Af: <a href="mailto:<%=rsOldnews("eforfattare")%>">
<% =rsOldnews("Forfattare") %>
</a>
</div>
<div id="id32"
</font>
<br>
<font size="2"color="#ffffff">
<% =rsOldnews("ingress") %>
</font>
<font size="1" color="000000"><a href="include2.asp?id=<%
=rsOldnews("id") %>">Læs
mere</a></font> <font
color="#3366CC"><strong>»</strong></font></td>
<td><img src="<% =strImageFolder & rsOldnews("Bild") %>"><br>
<font size="1">
<% =rsOldnews("Bildtext") %>
</div>
</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="image/tablebundny.jpg"></td>
</tr>
</table>
<br><br>
<%
antal=antal+1
rsOldnews.movenext
loop
rsOldnews.close
set rsoldnews = nothing
rsantal.close
set rsantal = nothing
%>
--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials