need help: Noobie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mcc

    #1

    need help: Noobie

    When i put these two java scripts in the same html file only the fade script
    works.

    Why is that???





    this part is in the <head>



    <!-Rollover Script à



    <SCRIPT TYPE="text/javascript">

    <!--



    function newImage(arg) {

    if (document.image s) {

    rslt = new Image();

    rslt.src = arg;

    return rslt;

    }

    }



    function changeImages() {

    if (document.image s && (preloadFlag == true)) {

    for (var i=0; i<changeImages. arguments.lengt h; i+=2)
    {

    document[changeImages.ar guments[i]].src
    = changeImages.ar guments[i+1];

    }

    }

    }



    var preloadFlag = false;

    function preloadImages() {

    if (document.image s) {

    ebay_12_over = newImage("image s/ebay_12-over.gif");

    ebay_15_over = newImage("image s/ebay_15-over.gif");

    ebay_18_over = newImage("image s/ebay_18-over.gif");

    ebay_21_over = newImage("image s/ebay_21-over.gif");

    ebay_24_over = newImage("image s/ebay_24-over.gif");

    preloadFlag = true;

    }

    }



    // -->

    </SCRIPT>



    <!-Rollover Script End à





    this part is in the <body>




    ONMOUSEOVER="ch angeImages('eba y_15', 'images/ebay_15-over.gif'); return
    true;"


    ONMOUSEOUT="cha ngeImages('ebay _15', 'images/ebay_15.gif'); return true;">






    this(fade images) is in the <body>



    <!-- Fade Images -->

    <script language="JavaS cript1.2">



    var slideshow_width ='150px' //SET IMAGE WIDTH

    var slideshow_heigh t='100px' //SET IMAGE HEIGHT

    var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)



    var fadeimages=new Array()

    //SET IMAGE PATHS. Extend or contract array as needed

    fadeimages[0]="coin.jpg"

    fadeimages[1]="jewl.jpg"

    fadeimages[2]="gfx.jpg"

    fadeimages[3]="fiddle.jpg "

    fadeimages[4]="gold.jpg"

    fadeimages[5]="cam.jpg"

    fadeimages[4]="bbcards.jp g"





    ////NO need to edit beyond here/////////////



    var preloadedimages =new Array()

    for (p=0;p<fadeimag es.length;p++){

    preloadedimages[p]=new Image()

    preloadedimages[p].src=fadeimages[p]

    }



    var ie4=document.al l

    var dom=document.ge tElementById



    if (ie4||dom)

    document.write( '<div
    style="position :relative;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t
    +';overflow:hid den"><div id="canvas0"
    style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t
    +';top:0;left:0 ;filter:alpha(o pacity=10);-moz-opacity:10"></div><div
    id="canvas1"
    style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t
    +';top:0;left:0 ;filter:alpha(o pacity=10);-moz-opacity:10"></div></div>')

    else

    document.write( '<img name="defaultsl ide" src="'+fadeimag es[0]+'">')



    var curpos=10

    var degree=10

    var curcanvas="canv as0"

    var curimageindex=0

    var nextimageindex= 1





    function fadepic(){

    if (curpos<100){

    curpos+=10

    if (tempobj.filter s)

    tempobj.filters .alpha.opacity= curpos

    else if (tempobj.style. MozOpacity)

    tempobj.style.M ozOpacity=curpo s/100

    }

    else{

    clearInterval(d ropslide)

    nextcanvas=(cur canvas=="canvas 0")? "canvas0" : "canvas1"

    tempobj=ie4? eval("document. all."+nextcanva s) :
    document.getEle mentById(nextca nvas)

    tempobj.innerHT ML='<img src="'+fadeimag es[nextimageindex]+'">'

    nextimageindex= (nextimageindex <fadeimages.len gth-1)? nextimageindex+ 1 : 0

    setTimeout("rot ateimage()",pau se)

    }

    }



    function rotateimage(){

    if (ie4||dom){

    resetit(curcanv as)

    var crossobj=tempob j=ie4? eval("document. all."+curcanvas ) :
    document.getEle mentById(curcan vas)

    crossobj.style. zIndex++

    var temp='setInterv al("fadepic()", 50)'

    dropslide=eval( temp)

    curcanvas=(curc anvas=="canvas0 ")? "canvas1" : "canvas0"

    }

    else

    document.images .defaultslide.s rc=fadeimages[curimageindex]

    curimageindex=( curimageindex<f adeimages.lengt h-1)? curimageindex+1 : 0

    }



    function resetit(what){

    curpos=10

    var crossobj=ie4? eval("document. all."+what) : document.getEle mentById(what)

    if (crossobj.filte rs)

    crossobj.filter s.alpha.opacity =curpos

    else if (crossobj.style .MozOpacity)

    crossobj.style. MozOpacity=curp os/100

    }



    function startit(){

    var crossobj=ie4? eval("document. all."+curcanvas ) :
    document.getEle mentById(curcan vas)

    crossobj.innerH TML='<img src="'+fadeimag es[curimageindex]+'">'

    rotateimage()

    }



    if (ie4||dom)

    window.onload=s tartit

    else

    setInterval("ro tateimage()",pa use)



    </script>

    </TD>

    <!-- Fade Images -->







    thx,

    --


    joe


  • Ang Talunin

    #2
    Re: need help: Noobie

    Could you post your total file?

    "mcc" <easd@nospam.ne t> schreef in bericht
    news:7HHJb.2735 $zf.2484@okepre ad05...[color=blue]
    > When i put these two java scripts in the same html file only the fade[/color]
    script[color=blue]
    > works.
    >
    > Why is that???
    >
    >
    >
    >
    >
    > this part is in the <head>
    >
    >
    >
    > <!-Rollover Script à
    >
    >
    >
    > <SCRIPT TYPE="text/javascript">
    >
    > <!--
    >
    >
    >
    > function newImage(arg) {
    >
    > if (document.image s) {
    >
    > rslt = new Image();
    >
    > rslt.src = arg;
    >
    > return rslt;
    >
    > }
    >
    > }
    >
    >
    >
    > function changeImages() {
    >
    > if (document.image s && (preloadFlag == true)) {
    >
    > for (var i=0; i<changeImages. arguments.lengt h;[/color]
    i+=2)[color=blue]
    > {
    >
    >[/color]
    document[changeImages.ar guments[i]].src[color=blue]
    > = changeImages.ar guments[i+1];
    >
    > }
    >
    > }
    >
    > }
    >
    >
    >
    > var preloadFlag = false;
    >
    > function preloadImages() {
    >
    > if (document.image s) {
    >
    > ebay_12_over =[/color]
    newImage("image s/ebay_12-over.gif");[color=blue]
    >
    > ebay_15_over =[/color]
    newImage("image s/ebay_15-over.gif");[color=blue]
    >
    > ebay_18_over =[/color]
    newImage("image s/ebay_18-over.gif");[color=blue]
    >
    > ebay_21_over =[/color]
    newImage("image s/ebay_21-over.gif");[color=blue]
    >
    > ebay_24_over =[/color]
    newImage("image s/ebay_24-over.gif");[color=blue]
    >
    > preloadFlag = true;
    >
    > }
    >
    > }
    >
    >
    >
    > // -->
    >
    > </SCRIPT>
    >
    >
    >
    > <!-Rollover Script End à
    >
    >
    >
    >
    >
    > this part is in the <body>
    >
    >
    >
    >
    > ONMOUSEOVER="ch angeImages('eba y_15', 'images/ebay_15-over.gif'); return
    > true;"
    >
    >
    > ONMOUSEOUT="cha ngeImages('ebay _15', 'images/ebay_15.gif'); return true;">
    >
    >
    >
    >
    >
    >
    > this(fade images) is in the <body>
    >
    >
    >
    > <!-- Fade Images -->
    >
    > <script language="JavaS cript1.2">
    >
    >
    >
    > var slideshow_width ='150px' //SET IMAGE WIDTH
    >
    > var slideshow_heigh t='100px' //SET IMAGE HEIGHT
    >
    > var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
    >
    >
    >
    > var fadeimages=new Array()
    >
    > //SET IMAGE PATHS. Extend or contract array as needed
    >
    > fadeimages[0]="coin.jpg"
    >
    > fadeimages[1]="jewl.jpg"
    >
    > fadeimages[2]="gfx.jpg"
    >
    > fadeimages[3]="fiddle.jpg "
    >
    > fadeimages[4]="gold.jpg"
    >
    > fadeimages[5]="cam.jpg"
    >
    > fadeimages[4]="bbcards.jp g"
    >
    >
    >
    >
    >
    > ////NO need to edit beyond here/////////////
    >
    >
    >
    > var preloadedimages =new Array()
    >
    > for (p=0;p<fadeimag es.length;p++){
    >
    > preloadedimages[p]=new Image()
    >
    > preloadedimages[p].src=fadeimages[p]
    >
    > }
    >
    >
    >
    > var ie4=document.al l
    >
    > var dom=document.ge tElementById
    >
    >
    >
    > if (ie4||dom)
    >
    > document.write( '<div
    >[/color]
    style="position :relative;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t[color=blue]
    > +';overflow:hid den"><div id="canvas0"
    >[/color]
    style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t[color=blue]
    > +';top:0;left:0 ;filter:alpha(o pacity=10);-moz-opacity:10"></div><div
    > id="canvas1"
    >[/color]
    style="position :absolute;width :'+slideshow_wi dth+';height:'+ slideshow_heigh t[color=blue]
    > +';top:0;left:0 ;filter:alpha(o pacity=10);-moz-opacity:10"></div></div>')
    >
    > else
    >
    > document.write( '<img name="defaultsl ide" src="'+fadeimag es[0]+'">')
    >
    >
    >
    > var curpos=10
    >
    > var degree=10
    >
    > var curcanvas="canv as0"
    >
    > var curimageindex=0
    >
    > var nextimageindex= 1
    >
    >
    >
    >
    >
    > function fadepic(){
    >
    > if (curpos<100){
    >
    > curpos+=10
    >
    > if (tempobj.filter s)
    >
    > tempobj.filters .alpha.opacity= curpos
    >
    > else if (tempobj.style. MozOpacity)
    >
    > tempobj.style.M ozOpacity=curpo s/100
    >
    > }
    >
    > else{
    >
    > clearInterval(d ropslide)
    >
    > nextcanvas=(cur canvas=="canvas 0")? "canvas0" : "canvas1"
    >
    > tempobj=ie4? eval("document. all."+nextcanva s) :
    > document.getEle mentById(nextca nvas)
    >
    > tempobj.innerHT ML='<img src="'+fadeimag es[nextimageindex]+'">'
    >
    > nextimageindex= (nextimageindex <fadeimages.len gth-1)? nextimageindex+ 1 : 0
    >
    > setTimeout("rot ateimage()",pau se)
    >
    > }
    >
    > }
    >
    >
    >
    > function rotateimage(){
    >
    > if (ie4||dom){
    >
    > resetit(curcanv as)
    >
    > var crossobj=tempob j=ie4? eval("document. all."+curcanvas ) :
    > document.getEle mentById(curcan vas)
    >
    > crossobj.style. zIndex++
    >
    > var temp='setInterv al("fadepic()", 50)'
    >
    > dropslide=eval( temp)
    >
    > curcanvas=(curc anvas=="canvas0 ")? "canvas1" : "canvas0"
    >
    > }
    >
    > else
    >
    > document.images .defaultslide.s rc=fadeimages[curimageindex]
    >
    > curimageindex=( curimageindex<f adeimages.lengt h-1)? curimageindex+1 : 0
    >
    > }
    >
    >
    >
    > function resetit(what){
    >
    > curpos=10
    >
    > var crossobj=ie4? eval("document. all."+what) :[/color]
    document.getEle mentById(what)[color=blue]
    >
    > if (crossobj.filte rs)
    >
    > crossobj.filter s.alpha.opacity =curpos
    >
    > else if (crossobj.style .MozOpacity)
    >
    > crossobj.style. MozOpacity=curp os/100
    >
    > }
    >
    >
    >
    > function startit(){
    >
    > var crossobj=ie4? eval("document. all."+curcanvas ) :
    > document.getEle mentById(curcan vas)
    >
    > crossobj.innerH TML='<img src="'+fadeimag es[curimageindex]+'">'
    >
    > rotateimage()
    >
    > }
    >
    >
    >
    > if (ie4||dom)
    >
    > window.onload=s tartit
    >
    > else
    >
    > setInterval("ro tateimage()",pa use)
    >
    >
    >
    > </script>
    >
    > </TD>
    >
    > <!-- Fade Images -->
    >
    >
    >
    >
    >
    >
    >
    > thx,
    >
    > --
    >
    >
    > joe
    >
    >[/color]


    Comment

    • Michael Winter

      #3
      Re: need help: Noobie

      On Sun, 4 Jan 2004 12:36:54 +0100, Ang Talunin
      <please.no.spam @no-reply.com> wrote:
      [color=blue]
      > Could you post your total file?[/color]

      Could you please,

      1) Not top-post
      2) Trim your quotes

      To the OP: Instead of posting the file, can you point to an on-line,
      hosted copy of you page that features the scripts.

      Mike

      --
      Michael Winter
      M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

      Comment

      • mcc

        #4
        Re: need help: Noobie


        [color=blue]
        >[color=green]
        > > Could you post your total file?[/color][/color]


        i reposted up top...i made a simple web page. Should be easy for scripters
        to ts.


        Comment

        Working...