snippet library logo
Boxedart - Worlds Largest Development Center
in category
Javascript / OnMouseover / Scrolling table box
Snippet details
ID: 231
Viewed: 1494
Added: 2002-06-07
Version:
View Demo

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable Version
This script works with layers and a table. it makes 2 links one for up and one for down. very handy for people that don't like frames or Iframes.<br><br>Browsers: IE & NS

General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: unknown

<!---Head--->
none

<!---Body--->


<script language="JavaScript1.2">

iens6=document.all||document.getElementById
ns4=document.layers

//specify speed of scroll (greater=faster)
var speed=7

if (iens6){
document.write('<div id="container" style="position:relative;width:180;height:220;border:1px solid #3399CC;overflow:hidden">')
document.write('<div id="content" style="position:absolute;width:195;left:5;top:0">')
}
</script>

 <table border=1 bgstyle="color:#c0c0c0" width="170" height="140">
<tr><td>

<ilayer name="nscontainer" width=200 height=210 clip="0,0,175,160">
<layer name="nscontent" width=190 height=190 visibility=hidden>


<!--INSERT CONTENT HERE-->
<p><font size="2" face="Arial" style="color:#d9e5ed">Hi, this is a scrolling script that
 runs in IE and NS. This script is located at <a href="http://www.snippetlibrary.com">
 www.snippetlibrary.com</a> and is free to all users that wish to use it. Please feel
  free to upload more scripts so everybody else can have some pleasure. <br>
<br>
<font style="color:#FFFF99">Hi, this is a scrolling script that
 runs in IE and NS. This script is located at <a href="http://www.snippetlibrary.com">
 www.snippetlibrary.com</a> and is free to all users that wish to use it. Please feel
  free to upload more scripts so everybody else can have some pleasure. </font></font></p>
<p><font size="2" face="verdana" style="color:#000000">Hi, this is a scrolling script that
 runs in IE and NS. This script is located at <a href="http://www.snippetlibrary.com">
 www.snippetlibrary.com</a> and is free to all users that wish to use it. Please feel
  free to upload more scripts so everybody else can have some pleasure.  <br>
<br>
<font size="1">Hi, this is a scrolling script that
 runs in IE and NS. This script is located at <a href="http://www.snippetlibrary.com">
 www.snippetlibrary.com</a> and is free to all users that wish to use it. Please feel
  free to upload more scripts so everybody else can have some pleasure. </font></font></p>
<p>
<!--END CONTENT-->
</p>
</layer>
</ilayer>
</td></tr></table>
<script language="JavaScript1.2">
if (iens6)
document.write('</div></div>')
</script>

<table width="170px"><td>
<a href="#" onMouseover="moveup()" onMouseout="clearTimeout(moveupvar)">UP</a>
<a href="#" onMouseover="movedown()" onMouseout="clearTimeout(movedownvar)">DOWN</a>
</table>

<script language="JavaScript1.2">
if (iens6){
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}

function movedown(){
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",100)
}

function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",100)

}

function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}
window.onload=getcontent_height
</script>





No Reviews to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.