Time dependent image display

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

    #1

    Time dependent image display

    Hi,

    i'm getting no success, with my attempt
    displaying some pictures one after another
    for i.e. some seconds.

    null.jpg is a white site!

    Really thanks for any help,
    regards,Christi an


    <html>
    <SCRIPT type="text/javascript">
    function image_on()
    { setTimeout("ima ge_off()",4000) }

    function image_off()
    {document.image s[0].src=(c:/omninet/null.jpg)}

    </SCRIPT>
    <body>

    <IMG onLoad="image_o n()" src=/picture1.jpg >

    <IMG onLoad="image_o n()" src=/picture2.jpg>

    <IMG onLoad="image_o n()" src=/picture3.jpg>

    </body>
    </html>
  • George Ziniewicz

    #2
    Re: Time dependent image display


    "christian" <ozric@web.de > wrote in message
    news:1a3a333a.0 308120414.4fd9e 343@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > i'm getting no success, with my attempt
    > displaying some pictures one after another
    > for i.e. some seconds.[/color]

    Generally the way it is done is for you to place the pic names in an
    array, and sequentially load them via a timer() using an incrementing
    counter as an array index. Here is an IE slideshow I wrote:



    Another version: http://zintel.com/snaps.html


    [color=blue]
    > null.jpg is a white site!
    >
    > Really thanks for any help,
    > regards,Christi an
    >
    >
    > <html>
    > <SCRIPT type="text/javascript">
    > function image_on()
    > { setTimeout("ima ge_off()",4000) }
    >
    > function image_off()
    > {document.image s[0].src=(c:/omninet/null.jpg)}
    >
    > </SCRIPT>
    > <body>
    >
    > <IMG onLoad="image_o n()" src=/picture1.jpg >[/color]

    I don't see an onLoad method n the IMG spec.

    It is good practice to wrap your attribute values in quotes, here the
    "/picture1.jpg"


    [color=blue]
    > <IMG onLoad="image_o n()" src=/picture2.jpg>
    >
    > <IMG onLoad="image_o n()" src=/picture3.jpg>
    >
    > </body>
    > </html>[/color]

    zin



    Comment

    • George Ziniewicz

      #3
      Re: Time dependent image display


      "George Ziniewicz" <zin1@cox.net > wrote in message
      news:1c6_a.5587 0$Ne.16097@fed1 read03...[color=blue]
      >
      > "christian" <ozric@web.de > wrote in message
      > news:1a3a333a.0 308120414.4fd9e 343@posting.goo gle.com...[color=green]
      > > Hi,
      > >
      > > i'm getting no success, with my attempt
      > > displaying some pictures one after another
      > > for i.e. some seconds.[/color]
      >
      > Generally the way it is done is for you to place the pic names in an
      > array, and sequentially load them via a timer() using an incrementing
      > counter as an array index. Here is an IE slideshow I wrote:
      >
      > http://zintel.com/picsel.html
      >
      > Another version: http://zintel.com/snaps.html
      >
      >
      >[color=green]
      > > null.jpg is a white site!
      > >
      > > Really thanks for any help,
      > > regards,Christi an
      > >
      > >
      > > <html>
      > > <SCRIPT type="text/javascript">
      > > function image_on()
      > > { setTimeout("ima ge_off()",4000) }
      > >
      > > function image_off()
      > > {document.image s[0].src=(c:/omninet/null.jpg)}
      > >
      > > </SCRIPT>
      > > <body>
      > >
      > > <IMG onLoad="image_o n()" src=/picture1.jpg >[/color]
      >
      > I don't see an onLoad method n the IMG spec.[/color]

      My mistake, there is one!


      [color=blue]
      > It is good practice to wrap your attribute values in quotes, here the
      > "/picture1.jpg"
      >
      >
      >[color=green]
      > > <IMG onLoad="image_o n()" src=/picture2.jpg>
      > >
      > > <IMG onLoad="image_o n()" src=/picture3.jpg>
      > >
      > > </body>
      > > </html>[/color]
      >
      > zin
      >
      >
      >[/color]


      Comment

      • andy johnson

        #4
        Re: Time dependent image display

        On Tue, 12 Aug 2003 08:12:07 -0700, "George Ziniewicz" <zin1@cox.net >
        wrote:
        [color=blue]
        >
        >"George Ziniewicz" <zin1@cox.net > wrote in message
        >news:1c6_a.558 70$Ne.16097@fed 1read03...[color=green]
        >>
        >> "christian" <ozric@web.de > wrote in message
        >> news:1a3a333a.0 308120414.4fd9e 343@posting.goo gle.com...[color=darkred]
        >> > Hi,
        >> >
        >> > i'm getting no success, with my attempt
        >> > displaying some pictures one after another
        >> > for i.e. some seconds.[/color]
        >>
        >> Generally the way it is done is for you to place the pic names in an
        >> array, and sequentially load them via a timer() using an incrementing
        >> counter as an array index. Here is an IE slideshow I wrote:
        >>
        >> http://zintel.com/picsel.html
        >>
        >> Another version: http://zintel.com/snaps.html
        >>
        >>[/color][/color]
        So, for those of me who are not java literate but trying to grasp it,
        can you post a stand alone working script ???

        Thanks,

        Andy

        "There would be a lot more civility in this world if people
        didn't take that as an invitation to walk all over you"
        - (Calvin and Hobbes)

        Comment

        • George Ziniewicz

          #5
          Re: Time dependent image display

          "andy johnson" <andrew.johnson @chicagonet.net > wrote in message news:o28ijvo5nt gl5bdnl6oi72ohq 9uhqcgf7v@4ax.c om...
          On Tue, 12 Aug 2003 08:12:07 -0700, "George Ziniewicz" <zin1@cox.net >
          wrote:
          [color=blue]
          >
          >"George Ziniewicz" <zin1@cox.net > wrote in message
          >news:1c6_a.558 70$Ne.16097@fed 1read03...[color=green]
          >>
          >> "christian" <ozric@web.de > wrote in message
          >> news:1a3a333a.0 308120414.4fd9e 343@posting.goo gle.com...[color=darkred]
          >> > Hi,
          >> >
          >> > i'm getting no success, with my attempt
          >> > displaying some pictures one after another
          >> > for i.e. some seconds.[/color]
          >>
          >> Generally the way it is done is for you to place the pic names in an
          >> array, and sequentially load them via a timer() using an incrementing
          >> counter as an array index. Here is an IE slideshow I wrote:
          >>
          >> http://zintel.com/picsel.html
          >>
          >> Another version: http://zintel.com/snaps.html
          >>
          >>[/color][/color]
          So, for those of me who are not java literate but trying to grasp it,
          can you post a stand alone working script ???



          Here is a fairly minimal slideshow (the minimum I would do), featuring a table centered pic, selectable delay, click to hold/continue, and onscreen info. All that needs changing is to set "base" to the basepath of your images like 'myFolder/birthday/') and put the pic names in the pic array list like 'file1.jpg','fi le1.gif' ...:


          btw, here is a new "fullscreen " slideshow I posted today, I tried for cross-browser but w/ IE features, with zoom, filters, draggable and hideable menu, scrolling div info, etc:



          zin

          ---------------------------------------------------

          <html><head><ti tle>Minimal Slide Show</title>

          <!-- --- style for a dark background, optional --- -->

          <style type='text/css'>
          body{
          color:#FFFFFF;
          background-color:#111111;
          }
          input{
          text-align:center;
          }
          </style>

          <!-- ------- script for slideshow functions ------- -->

          <script type='text/javascript'>
          <!-- hide script content from old browsers

          var base='snaps/'; // base dir of images

          var pics=new Array( // list of file names in dir to show
          "k6077.jpg","k6 080.jpg","k6086 .jpg","k6088.jp g","k6094.jp g"
          );

          var on=1; // run flag
          var picnum=-1; // current pic #
          var timerID=0;
          var interval=3000; // 3 second delay

          //----------------------------------------------------------
          //----------------------------------------------------------
          //----------------------------------------------------------

          function advance() { // move to the next pic:
          picnum+=1; // increment
          picnum%=pics.le ngth; // wraparound if necessary
          }

          //----------------------------------------------------------

          function show() { // show current pic:
          document.pic.sr c=base+pics[picnum]; // load it
          document.pic.al t=pics[picnum]; // update alt
          update();
          }

          //----------------------------------------------------------

          function timer() {
          if (on) { // if running
          advance(); // next one
          show(); // show it
          }
          timerID=setTime out('timer()',i nterval); // next time
          }

          //----------------------------------------------------------

          function toggle() {
          switch (on) {
          case 0: // if off
          on=1;
          advance();
          show();
          update();
          timer();
          break;
          case 1: // if on
          on=0;
          update();
          clearTimeout(ti merID);
          break;
          }
          }

          //----------------------------------------------------------

          function update() { // update onscreen info
          var str;
          if (on) {
          str='PLAY: ';
          document.myForm .myText.style.b ackgroundColor= 'white';
          } else {
          str='HOLD: ';
          document.myForm .myText.style.b ackgroundColor= 'yellow';
          }
          document.myForm .myText.value=s tr+pics[picnum]; // name
          }

          //----------------------------------------------------------

          // ...end hiding content from old browsers -->
          </script>
          </head>

          <!-- ----------------------------------------------------- -->
          <!-- ----------------------------------------------------- -->
          <!-- ----------------------------------------------------- -->

          <body onLoad='timer() ;'>
          <center>

          <!-- --------------- form for widgets --------------- -->

          <form name='myForm' onSubmit='retur n false'>
          <input type='text' name='myText' width='20'>
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp;

          Delay:
          <select onChange='clear Timeout(timerID );
          interval=(selec tedIndex+1)*100 0; timer();'>
          <option>1 <option>2 <option selected='selec ted'>3
          <option>4 <option>5 <option>6 <option>7 <option>8
          </select>
          Sec.
          &nbsp;&nbsp;&nb sp;&nbsp;&nbsp;

          Click Pic to Hold or Continue
          <br />
          </form>

          <!-- --------- table to hold a centered pic --------- -->

          <table align='center' valign='middle' height='100%' border='0'>
          <tr><td align='center' valign='middle' >
          <img src='' name='pic' id='pic' onClick='toggle ();'>
          </td></tr>
          </table>

          </center>
          </body>
          </html>


          Comment

          • Patrick Fitzgerald

            #6
            Re: Time dependent image display

            ozric@web.de (christian) wrote in message news:<1a3a333a. 0308120414.4fd9 e343@posting.go ogle.com>...[color=blue]
            >
            > i'm getting no success, with my attempt
            > displaying some pictures one after another
            > for i.e. some seconds.[/color]

            You can check out my site for an example:


            Comment

            Working...