Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    ubh
    ubh is offline
    Regular Coder ubh's Avatar
    Join Date
    Apr 2008
    Location
    Portland, Oregon U.S.A.
    Posts
    443
    Thanks
    108
    Thanked 15 Times in 14 Posts

    Scrollable content II Modification Help

    Hi,
    I was wondering if anyone could help me make the below script scroll text not up and down but left and right.

    http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm

    I have been trying to accomplish this for sometime now but I am not that good with JavaScript.

    I don't want to change any of the internal workings of the script but only need it to be scrolling left to right instead of up and down.

    Can anyone please help me with this?

    MANY MANY Thanks in advance.
    UbH

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Change your script to:
    Code:
    <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.left)>=(contentheight*(-1)+100))
    crossobj.style.left=parseInt(crossobj.style.left)-speed+"px"
    else if (ns4&&crossobj.left>=(contentheight*(-1)+100))
    crossobj.left-=speed
    movedownvar=setTimeout("movedown()",20)
    }
    
    function moveup(){
    if (iens6&&parseInt(crossobj.style.left)<=0)
    crossobj.style.left=parseInt(crossobj.style.left)+speed+"px"
    else if (ns4&&crossobj.left<=0)
    crossobj.left+=speed
    moveupvar=setTimeout("moveup()",20)
    
    }
    
    function getcontent_height(){
    if (iens6)
    contentheight=crossobj.offsetHeight
    else if (ns4)
    document.nscontainer.document.nscontent.visibility="show"
    }
    window.onload=getcontent_height
    </script>
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •