Results 1 to 1 of 1

Thread: Problem with IFRAME scroller JS

  1. #1
    Join Date
    Jul 2010
    Posts
    45
    Thanks
    6
    Thanked 4 Times in 2 Posts

    Question Problem with IFRAME scroller JS

    Hello,
    i'm trying to post news on my site. so i modified this http://www.dynamicdrive.com/dynamici...e-scroller.htm

    this is the modified page http://www.shmtestforums.uphero.com/...ller/test.html

    but i couldn't get, exactly what i want. i really want is
    • when load the page it should shows only 3 rows

    • then after few seconds(say 2 seconds), the 1st row should disappear and bellow 3 rows should come up
      (eg. when dynamicdrive_1 row is disappear, dynamicdrive_2 & dynamicdrive_3 & dynamicdrive_4 rows should come up)

    • this rotation should be continuous



    i tried this many. but no positive result.
    please help me.

    this is the problematic java script
    Code:
    <script type="text/javascript">
    
    var scrollspeed=cache=1
    var initialdelay=500
    
    function initializeScroller(){
    	dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
    	dataobj.style.top="5px"
    	setTimeout("getdataheight()", initialdelay)
    }
    
    function getdataheight(){
    	thelength=dataobj.offsetHeight
    	if (thelength==0)
    		setTimeout("getdataheight()",10)
    	else
    		scrollDiv()
    }
    
    function scrollDiv(){
    		dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
    		if (parseInt(dataobj.style.top)<thelength*(-1))
    			dataobj.style.top="5px"
    		setTimeout("scrollDiv()",40)
    }
    
    if (window.addEventListener)
    		window.addEventListener("load", initializeScroller, false)
    else if (window.attachEvent)
    		window.attachEvent("onload", initializeScroller)
    else
    		window.onload=initializeScroller
    
    </script>
    Last edited by M rosi; 09-05-2010 at 06:18 AM.

Bookmarks

Posting Permissions

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