auto scrolling of the scrollbar of a page in iframe.....

Discussion in 'HTML & Website Design' started by romeo2010, Oct 19, 2007.

  1. #1
    Anyone Know how to make the scroll bar scrolling up and down automatically?

    basically auto scrolling of the scrollbar of a page in iframe.....
    i think its a javascript
     
    romeo2010, Oct 19, 2007 IP
  2. eruct

    eruct Well-Known Member

    Messages:
    1,189
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Do you mean like a news ticker or something that when the user rolls over in one direction it moves that way without them having to click?
     
    eruct, Oct 19, 2007 IP
  3. romeo2010

    romeo2010 Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    its is similar but not really......... the scroll bar will auto scroll such as ... same function as <marquee>.. except that this will make the scrollbar scroll down then go up again and go down... etc....
     
    romeo2010, Oct 19, 2007 IP
  4. mhaye_01

    mhaye_01 Banned

    Messages:
    395
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    you are referring to a frameset..?
    u have to be specific..
     
    mhaye_01, Oct 20, 2007 IP
  5. romeo2010

    romeo2010 Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it doesn't matter if its a frameset on not.... the point is whereever you put the code the scrollbar of that page will automatically start scrolling up and down....



    i found this code... except that this will only scroll down it doesn't scroll up again........ can someone modify it so that it work up and down

    
    
    <SCRIPT language=JavaScript1.2> 
    //change 1 to another integer to alter the scroll speed. Greater is faster
    
    var speed=1
    
    var currentpos=0,alt=1,curpos1=0,curpos2=-1
    
    function initialize(){
    
    startit()
    
    }
    
    function scrollwindow(){
    
    if (document.all &&
    
    !document.getElementById)
    
    temp=document.body.scrollTop
    
    else
    
    temp=window.pageYOffset
    
    if (alt==0)
    
    alt=2
    
    else
    
    alt=1
    
    if (alt==0)
    
    curpos1=temp
    
    else
    
    curpos2=temp
    
    if (curpos1!=curpos2){
    
    if (document.all)
    
    currentpos=document.body.scrollTop+speed
    
    else
    
    currentpos=window.pageYOffset+speed
    
    window.scroll(0,currentpos)
    
    }
    
    else{
    
    currentpos=0
    
    window.scroll(0,currentpos)
    
    }
    
    }
    
    function startit(){
    
    setInterval("scrollwindow()",50)
    
    }
    
    window.onload=initialize
    
    </SCRIPT>
    
    
    Code (markup):
     
    romeo2010, Oct 20, 2007 IP