JavaScroll-script i tabel
Jeg har et java script så man kan indsætte et felt med en scroller, og så to GIF´er "pil op" & "pil ned" så feltet scroller ned ved noget "mouse-over" halløj... men jeg kan ikke få det til at virke i forbindelse med tabeller....I første omgang så undlader jeg at sætte det script ind, og nøjes med at skrive noget af html´en til min side hvor scrolleren skal være....
<html>
<head>
<title>Nyheder</title>
</head>
<body>
<td width="157" height="490" bgcolor="#336699">
<div align="center">
<center>
<table border="0" cellspacing="0" width="148" height="480" cellpadding="0">
<tr>
<td height="43" bgcolor="#003366" background="/images/BG20-right-up.bmp" width="145">
<p align="center"><b><font face="MS Sans Serif" color="#FFFFFF" size="1">Nyheder:</font></b></td>
</tr>
*** denne tabel´s indhold der skal kunne scrolles i ***
<tr>
<td height="395" valign="top" align="left">
<p style="margin-left: 8" align="left"><a href="nyhed/07.html" CLASS=set2 target=""><font size="1"><b>07.Juli:</b> NYHED "nyhed7"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/06.html" CLASS=set2 target=""><font size="1"><b>06.Juli:</b> NYHED "nyhed6"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/05.html" CLASS=set2 target=""><font size="1"><b>05.Juli:</b> NYHED "nyhed5"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/04.html" CLASS=set2 target=""><font size="1"><b>04.Juli:</b> NYHED "nyhed4"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/03.html" CLASS=set2 target=""><font size="1"><b>03.Juli:</b> NYHED "nyhed3"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/02.html" CLASS=set2 target=""><font size="1"><b>02.Juli:</b> NYHED "nyhed2"</font></a>
</p>
<p style="margin-left: 8" align="left"><a href="nyhed/01.html" CLASS=set2 target=""><font size="1"><b>01.Juli:</b> NYHED "nyhed1"</font></a>
</p>
</td>
</tr>
*** og den må jo slutte her cirka ***
<tr>
<td height="42" bgcolor="#003366" background="/images/BG20-right-down.bmp" align="center" style="cursor: pointer" style="" onMouseOver = "this.style.backgroundColor='#336699';" OnMouseOut = "this.style.backgroundColor='#003366';" valign="middle" width="145">
<p style="margin-left: 8" align="center"><a href="/alle-nyheder.html" CLASS=set2 target=""><font size="1"><b>Alle nyheder >></b></font></a>
</p>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
Er der nogen der har et script til den funktion...??? jeg tror ikke det andet script jeg har fat i fungerer i tabeller...
Og hvor de forskellige dele skal stå i html´en... jeg er godt nok træt af at rode med det =)
Nej jeg tror lige jeg sætter scriptet ind alligevel...måske det bare skal modificeres eller sættes rigtig ind i min html...
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
// begin absolutely positioned scrollable area object scripts
// Extension developed by David G. Miles
// Original Scrollable Area code developed by Thomas Brattli
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()
var speed=200
var loop, timer
function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function MoveAreaDown(move){
if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
function MoveAreaUp(move){
if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
function PerformScroll(speed){
if(initialised){
loop=true;
if(speed>0) objScroller.down(speed)
else objScroller.up(speed)
}
}
function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('divContainer')
objScroller=new ConstructObject('divContent','divContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts
</script>
<style type="text/css">
#divUpControl{position:absolute; width:450; left:35%; top:32%; z-index:1; text-align: right}
#divDownControl{position:absolute; width:450; left:35%; top:42%; z-index:1; text-align: right}
#divContainer{position:absolute; width:450; height:600; overflow:hidden; top:32%; left:30%; clip:rect(0,450,600,0); visibility:hidden}
#divContent{position:absolute; top:32%; left:30%}
</style>
</head>
*****************************************
<body>
<!-- begin absolutely positioned scrollable area object-->
<div id="divUpControl" style="z-index: 2; left: 60%; top: 2%">
<div align="left"><a href="java script:;" onMouseOver="PerformScroll(-7)" onMouseOut="CeaseScroll()"><img src="/images/pil_op.jpg" width="10" height="10" border="no" title="SCROLL OP"></a>
</div>
</div>
<div id="divDownControl" style="z-index: 2; left: 75%; top: 2%">
<div align="left"><a href="java script:;" onMouseOver="PerformScroll(7)" onMouseOut="CeaseScroll()"><img src="/images/pil_ned.jpg" width="10" height="10" border="no" title="SCROLL NED"></a>
</div>
</div>
<div id="divContainer" style="clip: rect(0 450 500 0); z-index: 1; left: 4%; top: 8%; width: 130; height: 500; background-image: url(pic/midt_bag2.gif); layer-background-image: url(pic/midt_bag.gif); border: 1px none #000000; visibility: visible">
<div id="divContent" align="left">
<div
<!--
** her er scroll-teksten **
*BLA-BLA-BLA <br> *BLA-BLA-BLA* <br> *BLA-BLA-BLA <br> *BLA-BLA-BLA* <br> *BLA-BLA-BLA*
<!-- end absolutely positioned scrollable area object -->
</div>
</body>
</html>
Forstået???...ellers spørg =)
//Jeuann
