PDA

View Full Version : newbie - center the scroller



Gironimo
05-14-2005, 08:02 PM
Hi all,

sorry for my bad english. I´am a newbie in web-development. We have a homepage and I´m that one, who have to administer this page. :-))) I found some nice scrollers on dynamic drive and i use the memory scroller who works finde.
My problem is, that the scroller isn`t in the center of the page.
Can anyone help me. The html code is below and you can vistit the page under www.rk-aitrang.de

Thank you

Juergen :confused:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<title>No Cache Page</title>
<script language="JavaScript">
<!---
var frameseite = "index.htm"
if(top.frames.length == 0)
{document.location.href=frameseite;}
//-->
</script>
<title>Reservistenkameradschaft Aitrang</title>
<BASE TARGET="_parent">

</HEAD>
<link rel='stylesheet' type='text/css' href='./scripts/standard.css'>

<BODY class="body_content">
<table border="0" id="AutoNumber1" style="border-collapse: collapse" width="522">
<tr>
<td width="17" class="text">&nbsp;</td>
<td width="501" class="text">&nbsp;</td>
</tr>
<tr>
<td width="17" class="text">&nbsp;</td>
<td width="500" class="text">
Wir - die RK Aitrang - gehören dem Verband der Reservisten der Deutschen Bundeswehr e.V. (VdRBw) an. Dies ist eine starke
Gemeinschaft mit über 135.000 Mitgliedern. Zu ihr kommen Reservisten der Bundeswehr als ordentliche und
aktive Soldaten als außerordentliche Mitglieder. Vertreten sind alle Dienstgrade: vom Gefreiten bis zum General.
Auch diejenigen, die keinen Wehrdienst absolviert haben, können dem VdRBw als Fördernde Mitglieder beitreten.<BR><BR>
Als demokratisch legitimierter Verband bekennen wir uns in aller Deutlichkeit zu den Grundwerten und der Verteidigungswürdigkeit unserer Demokratie. <BR><BR>Die Verfolgung verfassungsfeindlicher Ziele ist deshalb mit einer
Mitgliedschaft bei uns unvereinbar.
</td>
</tr>


</TABLE>
<br><br>
<br>
<table width="522" border="0" cellpadding="0" cellspacing="0" bgcolor="#66CCFF" id="AutoNumber3" style="border-collapse: collapse">
<tr>
<td width="17" class="text">&nbsp;</td>
<td width="501" class="text"style="border-top: 2px solid">&nbsp;</td>
</tr>

<tr>
<td class="text">&nbsp;</td>
<td class="text">&nbsp;</td>
</tr>


<script type="text/javascript">

/***********************************************
* Memory Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var memorywidth="350px" //scroller width
var memoryheight="20px" //scroller height
var memorybgcolor="#DEFDD9" //scroller background
var memorypadding="2px" //padding applied to the scroller. 0 for non.
var borderCSS="border: 1px solid black;" //Border CSS, applied to scroller to give border.

var memoryspeed=2 //Scroller speed (larger is faster 1-10)
var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?

var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
var persistmsgbehavior="onload" //set to "onload" or "onclick".

//Specify the scroller's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var memorycontent='<nobr><span style="font: bold 13px Verdana">Hier gibt es in kürze Aktuelle Terminhinweise - </a> Nächster Schiesstermin der RAG in Obergünzburg am 17.05.05 um 19.00 - 22.00 Uhr"</a></span></nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////
var combinedcssTable="width:"+(parseInt(memorywidth)+6)+"px;background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"

var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
var copyspeed=memoryspeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px">'+memorycontent+'</span>')
var actualwidth=''
var memoryscroller

if (window.addEventListener)
window.addEventListener("load", populatescroller, false)
else if (window.attachEvent)
window.attachEvent("onload", populatescroller)
else if (document.all || document.getElementById)
window.onload=populatescroller

function populatescroller(){
memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
revivelastmsg()
memoryscroller.innerHTML=memorycontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
lefttime=setInterval("scrollmarquee()",20)
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function savelastmsg(){
document.cookie="lastscrollerpos="+memoryscroller.style.left
}

function revivelastmsg(){
lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
}

if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg

function scrollmarquee(){
if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
else
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
}

if (iedom){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
write('<div style="position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
write('</div>')
document.write('</td></table>')
}
}
</script>

<tr>
<td class="text">&nbsp;</td>
<td class="text">&nbsp;</td>
</tr>

<tr>
<td class="text">&nbsp;</td>
<td class="text">&nbsp;</td>
</tr>

</table>
</BODY>
</HTML>

Gironimo
05-17-2005, 04:03 PM
my colleague from work had a solution

:p