Java Script HELP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Java Script HELP

    Hi people im busy with a script but im stuck now....
    I cant seem to get that big space to disappear between the images, i want it to scroll all images simultaneously in a conveyor fashion. please help me.

    Code:
    <script language="JavaScript1.2">
    
    
    var scrollerwidth='135px'
    var scrollerheight='500px'
    var pausebetweenimages=0
    
    
    var slideimages=new Array()
    slideimages[0]='<img src="kastele/kasteel1.jpg">'
    slideimages[1]='<img src="kastele/kasteel2.jpg">'
    slideimages[2]='<img src="kastele/kasteel3.jpg">'
    slideimages[3]='<img src="kastele/kasteel4.jpg">'
    slideimages[4]='<img src="kastele/kasteel5.jpg">'
    slideimages[5]='<img src="kastele/kasteel6.jpg">'
    slideimages[6]='<img src="kastele/kasteel7.jpg">'
    slideimages[7]='<img src="kastele/kasteel8.jpg">'
    slideimages[8]='<img src="kastele/kasteel9.jpg">'
    slideimages[9]='<img src="kastele/kasteel10.jpg">'
    slideimages[10]='<img src="kastele/kasteel11.jpg">'
    slideimages[11]='<img src="kastele/kasteel12.jpg">'
    slideimages[12]='<img src="kastele/kasteel13.jpg">'
    slideimages[13]='<img src="kastele/kasteel14.jpg">'
    slideimages[14]='<img src="kastele/kasteel15.jpg">'
    slideimages[15]='<img src="kastele/kasteel16.jpg">'
    slideimages[16]='<img src="kastele/kasteel17.jpg">'
    slideimages[17]='<img src="kastele/kasteel18.jpg">'
    slideimages[18]='<img src="kastele/kasteel19.jpg">'
    slideimages[19]='<img src="kastele/kasteel20.jpg">'
    slideimages[20]='<img src="kastele/kasteel21.jpg">'
    slideimages[21]='<img src="kastele/kasteel22.jpg">'
    slideimages[22]='<img src="kastele/kasteel23.jpg">'
    slideimages[23]='<img src="kastele/kasteel24.jpg">'
    slideimages[24]='<img src="kastele/kasteel25.jpg">'
    slideimages[25]='<img src="kastele/kasteel26.jpg">'
    slideimages[26]='<img src="kastele/kasteel27.jpg">'
    slideimages[27]='<img src="kastele/kasteel28.jpg">'
    slideimages[28]='<img src="kastele/kasteel29.jpg">'
    slideimages[29]='<img src="kastele/kasteel30.jpg">'
    slideimages[30]='<img src="kastele/kasteel31.jpg">'
    slideimages[31]='<img src="kastele/kasteel32.jpg">'
    slideimages[32]='<img src="kastele/kasteel33.jpg">'
    slideimages[33]='<img src="kastele/kasteel34.jpg">'
    slideimages[34]='<img src="kastele/kasteel35.jpg">'
    slideimages[35]='<img src="kastele/kasteel36.jpg">'
    slideimages[36]='<img src="kastele/kasteel37.jpg">'
    slideimages[37]='<img src="kastele/kasteel38.jpg">'
    slideimages[38]='<img src="kastele/kasteel39.jpg">'
    slideimages[39]='<img src="kastele/kasteel40.jpg">'
    slideimages[41]='<img src="kastele/kasteel41.jpg">'
    slideimages[42]='<img src="kastele/kasteel42.jpg">'
    slideimages[43]='<img src="kastele/kasteel43.jpg">'
    slideimages[44]='<img src="kastele/kasteel44.jpg">'
    slideimages[45]='<img src="kastele/kasteel45.jpg">'
    slideimages[46]='<img src="kastele/kasteel46.jpg">'
    slideimages[47]='<img src="kastele/kasteel47.jpg">'
    slideimages[48]='<img src="kastele/kasteel48.jpg">'
    slideimages[49]='<img src="kastele/kasteel49.jpg">'
    slideimages[50]='<img src="kastele/kasteel50.jpg">'
    slideimages[51]='<img src="kastele/kasteel51.jpg">'
    
    
    
    var ie=document.all
    var dom=document.getElementById
    
    if (slideimages.length>2)
    i=2
    else
    i=0
    
    function move1(whichlayer){
    tlayer=eval(whichlayer)
    if (tlayer.top>0&&tlayer.top<=5){
    tlayer.top=0
    setTimeout("move1(tlayer)",pausebetweenimages)
    setTimeout("move2(document.main.document.second)",pausebetweenimages)
    return
    }
    if (tlayer.top>=tlayer.document.height*-1){
    tlayer.top-=5
    setTimeout("move1(tlayer)",50)
    }
    else{
    tlayer.top=parseInt(scrollerheight)
    tlayer.document.write(slideimages[i])
    tlayer.document.close()
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }
    
    function move2(whichlayer){
    tlayer2=eval(whichlayer)
    if (tlayer2.top>0&&tlayer2.top<=5){
    tlayer2.top=0
    setTimeout("move2(tlayer2)",pausebetweenimages)
    setTimeout("move1(document.main.document.first)",pausebetweenimages)
    return
    }
    if (tlayer2.top>=tlayer2.document.height*-1){
    tlayer2.top-=5
    setTimeout("move2(tlayer2)",50)
    }
    else{
    tlayer2.top=parseInt(scrollerheight)
    tlayer2.document.write(slideimages[i])
    tlayer2.document.close()
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }
    
    function move3(whichdiv){
    tdiv=eval(whichdiv)
    if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
    tdiv.style.top=0+"px"
    setTimeout("move3(tdiv)",pausebetweenimages)
    setTimeout("move4(second2_obj)",pausebetweenimages)
    return
    }
    if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
    tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
    setTimeout("move3(tdiv)",50)
    }
    else{
    tdiv.style.top=scrollerheight
    tdiv.innerHTML=slideimages[i]
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }
    
    function move4(whichdiv){
    tdiv2=eval(whichdiv)
    if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
    tdiv2.style.top=0+"px"
    setTimeout("move4(tdiv2)",pausebetweenimages)
    setTimeout("move3(first2_obj)",pausebetweenimages)
    return
    }
    if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
    tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
    setTimeout("move4(second2_obj)",50)
    }
    else{
    tdiv2.style.top=scrollerheight
    tdiv2.innerHTML=slideimages[i]
    if (i==slideimages.length-1)
    i=0
    else
    i++
    }
    }
    
    function startscroll(){
    if (ie||dom){
    first2_obj=ie? first2 : document.getElementById("first2")
    second2_obj=ie? second2 : document.getElementById("second2")
    move3(first2_obj)
    second2_obj.style.top=scrollerheight
    second2_obj.style.visibility='visible'
    }
    else if (document.layers){
    document.main.visibility='show'
    move1(document.main.document.first)
    document.main.document.second.top=parseInt(scrollerheight)+5
    document.main.document.second.visibility='show'
    }
    }
    
    window.onload=startscroll
    
    </script>
    
    
    <ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; visibility=hide>
    <layer id="first" left=0 top=1 width=&{scrollerwidth};>
    <script language="JavaScript1.2">
    if (document.layers)
    document.write(slideimages[0])
    </script>
    </layer>
    <layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
    <script language="JavaScript1.2">
    if (document.layers)
    document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
    </script>
    </layer>
    </ilayer>
    
    <script language="JavaScript1.2">
    if (ie||dom){
    document.writeln('<div id="main2" 
    
    style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;">')
    document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 
    
    '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
    document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
    document.write(slideimages[0])
    document.writeln('</div>')
    document.writeln('<div id="second2" 
    
    style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
    document.write(slideimages[dyndetermine=(slideimages.length==1)? 0 : 1])
    document.writeln('</div>')
    document.writeln('</div>')
    document.writeln('</div>')
    }
    </script>
    BakGat
    Code:
    class Counter {
    public:
      void Count();
      int  ReadDisplay();
    private:
      int  CurrentCount;
    };








    Back up my hard drive? How do I put it in reverse?
    My Community
    BakGat
    sigpic

    #2
    Still waiting for a respond to this..... JavaScript really isn't my strong point.... I've come so far to get it to this.... my better version can be found here Burger's Springkastele En Partytjie Benodighede I perfected it somewhat.... but this would have work so much better....
    BakGat
    Code:
    class Counter {
    public:
      void Count();
      int  ReadDisplay();
    private:
      int  CurrentCount;
    };








    Back up my hard drive? How do I put it in reverse?
    My Community
    BakGat
    sigpic

    Comment

    Working...
    X