PDA

View Full Version : Making Scrollable content II horizontal



LikwidNyte
10-18-2004, 06:34 PM
I'm trying to make the Scrollable Content II (http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm) a horizontal scroll. If anyone can help, it'd be much appreciated. I already tried to change some varibles of the script, those most logic, but I wasn't able to succeed in having it move left-right rather than up and down.

Sadjow
12-21-2006, 11:54 AM
<script type="text/javascript">

/******************************************
* Scrollable content2 script II- Dynamic Drive (www.dynamicdrive.com)
* adapted for Sadjow. http://www.sadjow.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

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

//specify speed2 of scroll (greater=faster)
var speed2=2

if (iens6){
document.write('<div id="container2" style="position:relative;font-size: 12px;font-family:Verdana, Helvetica, Arial, sans-serif;text-align:justify;width:415px;height:130px;color:#666;overflow:hidden">')
document.write('<div id="content2" style="position:absolute;width:410px;left:5;top:5;">')
}
</script>

<ilayer name="nscontainer2" width=175 height=160 clip="0,0,175,160">
<layer name="nscontent2" width=175 height=160 visibility=hidden>

<!--INSERT content2 HERE-->
<nobr><img src="imgs/complexo01.jpg" border="0">&nbsp;<img src="imgs/complexo02.jpg" border="0">&nbsp;<img src="imgs/complexo03.jpg" border="0">&nbsp;<img src="imgs/complexo01.jpg" border="0">&nbsp;<img src="imgs/complexo02.jpg" border="0">a&nbsp;<img src="imgs/complexo03.jpg" border="0">&nbsp;<img src="imgs/complexo01.jpg" border="0">&nbsp;<img src="imgs/complexo02.jpg" border="0">&nbsp;<img src="imgs/complexo03.jpg" border="0">&nbsp;</nobr>
<!--END content2-->

</layer>
</ilayer>

<script language="JavaScript1.2">
if (iens6)
document.write('</div></div>')
</script>

<table width="415px"><td><p align="right">
<a href="#" onMouseover="moveup2()" onMouseout="clearTimeout(moveup2var)"><img src="imgs/up.gif" border=0></a> <a href="#" onMouseover="movedown2()" onMouseout="clearTimeout(movedown2var)"><img src="imgs/down.gif" border=0></a></p></td>
</table>

<script language="JavaScript1.2">
if (iens6){
var crossobj2=document.getElementById? document.getElementById("content2") : document.all.content2
var content2width=crossobj2.offsetWidth
}
else if (ns4){
var crossobj2=document.nscontainer2.document.nscontent2
var content2width=crossobj2.clip.width
}

function movedown2(){
if (iens6&&parseInt(crossobj2.style.left)>=(content2width*(-1)+100))
crossobj2.style.left=parseInt(crossobj2.style.left)-speed2+"px"
else if (ns4&&crossobj2.left>=(content2width*(-1)+100))
crossobj2.left-=speed2
movedown2var=setTimeout("movedown2()",20)
}

function moveup2(){
if (iens6&&parseInt(crossobj2.style.left)<=0)
crossobj2.style.left=parseInt(crossobj2.style.left)+speed2+"px"
else if (ns4&&crossobj2.left<=0)
crossobj2.left+=speed2
moveup2var=setTimeout("moveup2()",20)

}

function getcontent2_width(){
if (iens6)
content2width=crossobj2.offsetWidth
else if (ns4)
document.nscontainer2.document.nscontent2.visibility="show"
}
window.onload=getcontent2_width
</script>

have a problem with FireFoX

http://www.sadjow.com