Image show with javascript

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

    Image show with javascript

    I am a total newbie to javascript. I have only done Frontpage.

    I am trying to do a page of image show----I only managed to find a
    javascript to create pop up windows for the chosen image. Almost good
    but I want better.


    I want the viewer to lick on the text word in the main page and the
    corresponding image will show in the iframe instantly, (or text in the
    frame and image on the main page). It will be about 30 images so I
    will need to download them all first.

    I cannot find any javascript to allow control of the frame from the
    main page, or the main page from the frame. Please help.

    main page=main.htm
    image=image.htm
    text=text1, text2,...
    image =pic1, pic2...



    ABC
    Do not reply by email. Replay to NG
  • Lee

    #2
    Re: Image show with javascript

    ABC said:
    [color=blue]
    >I want the viewer to lick on the text word in the main page and the
    >correspondin g image will show in the iframe instantly, (or text in the
    >frame and image on the main page).[/color]

    I have *got* to start making an effort to keep up with accessibility options.

    Comment

    • Dag Sunde

      #3
      Re: Image show with javascript

      "Lee" <REM0VElbspamtr ap@cox.net> wrote in message
      news:cre2o902hf u@drn.newsguy.c om...[color=blue]
      > ABC said:
      >[color=green]
      > >I want the viewer to lick on the text word in the main page and the
      > >correspondin g image will show in the iframe instantly, (or text in the
      > >frame and image on the main page).[/color]
      >
      > I have *got* to start making an effort to keep up with accessibility[/color]
      options.[color=blue]
      >[/color]

      Agree!

      This opens up for a completely new user experience...

      LOL!

      --
      Dag.


      Comment

      • McKirahan

        #4
        Re: Image show with javascript

        "ABC" <ABC@nospam.net > wrote in message
        news:5d1lt0t1gm r0lmuko86a8gkqp aof5hb2a0@4ax.c om...[color=blue]
        > I am a total newbie to javascript. I have only done Frontpage.
        >
        > I am trying to do a page of image show----I only managed to find a
        > javascript to create pop up windows for the chosen image. Almost good
        > but I want better.
        > http://www.fontstuff.com/frontpage/fptut17.htm
        >
        > I want the viewer to lick on the text word in the main page and the
        > corresponding image will show in the iframe instantly, (or text in the
        > frame and image on the main page). It will be about 30 images so I
        > will need to download them all first.
        >
        > I cannot find any javascript to allow control of the frame from the
        > main page, or the main page from the frame. Please help.
        >
        > main page=main.htm
        > image=image.htm
        > text=text1, text2,...
        > image =pic1, pic2...
        >
        >
        >
        > ABC
        > Do not reply by email. Replay to NG[/color]

        "I want the viewer to lick ..." -- so would I!

        Will this help? Watch for word-wrap.

        <html>
        <head>
        <title>iframed. htm</title>
        <script type="text/javascript">
        var pix = new Array();
        pix[0] = "http://www.fontstuff.c om/images/fptut17a_small. jpg";
        pix[1] = "http://www.fontstuff.c om/images/fptut17b_small. jpg";
        pix[2] = "http://www.fontstuff.c om/images/fptut17c_small. jpg";
        function pic(t) {
        document.all.i. src = pix[t];
        }
        </script>
        </head>
        <body>
        <center>
        <a href="javascrip t:pic(0)">Pictu re 1</a> |
        <a href="javascrip t:pic(1)">Pictu re 2</a> |
        <a href="javascrip t:pic(2)">Pictu re 3</a>
        <br><br>
        <iframe name="i" align="center"
        frameborder="0" scrolling="no"
        marginwidth="0" marginheight="0 "
        style="width:15 0; height:112"></iframe>
        <br><br>
        <sup><a href="http://www.fontstuff.c om/frontpage/fptut17.htm"
        target="_blank" >Making a Browser Window Fit an Image</a></sup>
        <center>
        </body>
        </html>


        Comment

        • Martin Honnen

          #5
          Re: Image show with javascript



          McKirahan wrote:

          [color=blue]
          > var pix = new Array();
          > pix[0] = "http://www.fontstuff.c om/images/fptut17a_small. jpg";
          > pix[1] = "http://www.fontstuff.c om/images/fptut17b_small. jpg";
          > pix[2] = "http://www.fontstuff.c om/images/fptut17c_small. jpg";
          > function pic(t) {
          > document.all.i. src = pix[t];[/color]

          If you want to script frames across browsers you would better use
          window.frames.i .location.href = ...
          [color=blue]
          > <a href="javascrip t:pic(0)">Pictu re 1</a> |
          > <a href="javascrip t:pic(1)">Pictu re 2</a> |
          > <a href="javascrip t:pic(2)">Pictu re 3</a>[/color]

          [color=blue]
          > <iframe name="i" align="center"
          > frameborder="0" scrolling="no"
          > marginwidth="0" marginheight="0 "
          > style="width:15 0; height:112"></iframe>[/color]

          What is the script good for, why not simply use links e.g.
          <a href="http://www.fontstuff.c om/images/fptut17a_small. jpg"
          target="i">Pict ure 1</a>
          ?

          --

          Martin Honnen

          Comment

          • McKirahan

            #6
            Re: Image show with javascript

            "Martin Honnen" <mahotrash@yaho o.de> wrote in message
            news:41daa050$0 $29423$9b4e6d93 @newsread4.arco r-online.net...[color=blue]
            >
            >
            > McKirahan wrote:
            >
            >[color=green]
            > > var pix = new Array();
            > > pix[0] = "http://www.fontstuff.c om/images/fptut17a_small. jpg";
            > > pix[1] = "http://www.fontstuff.c om/images/fptut17b_small. jpg";
            > > pix[2] = "http://www.fontstuff.c om/images/fptut17c_small. jpg";
            > > function pic(t) {
            > > document.all.i. src = pix[t];[/color]
            >
            > If you want to script frames across browsers you would better use
            > window.frames.i .location.href = ...[/color]

            Both work in IE5.5 and FF1.0.
            Neither works in NS6.2 and Opera6.1 (for me).
            [color=blue][color=green]
            > > <a href="javascrip t:pic(0)">Pictu re 1</a> |
            > > <a href="javascrip t:pic(1)">Pictu re 2</a> |
            > > <a href="javascrip t:pic(2)">Pictu re 3</a>[/color]
            >
            >[color=green]
            > > <iframe name="i" align="center"
            > > frameborder="0" scrolling="no"
            > > marginwidth="0" marginheight="0 "
            > > style="width:15 0; height:112"></iframe>[/color]
            >
            > What is the script good for, why not simply use links e.g.
            > <a href="http://www.fontstuff.c om/images/fptut17a_small. jpg"
            > target="i">Pict ure 1</a>
            > ?[/color]

            Excellent and it works in my 4 browsers!
            [color=blue]
            > --
            >
            > Martin Honnen
            > http://JavaScript.FAQTs.com/[/color]


            One thing I didn't do was preload the images per:

            "It will be about 30 images so I will need to download them all first."



            Comment

            • ABC

              #7
              Re: Image show with javascript

              On Tue, 04 Jan 2005 13:27:22 GMT, "Dag Sunde" <me@dagsunde.co m> wrotd:

              [color=blue]
              >Agree!
              >
              >This opens up for a completely new user experience...
              >[/color]
              Yeah . Very funny about the typo. But that is actually possible.....

              Do you have a script to help?

              ABC
              Do not reply by email. Replay to NG

              Comment

              • ABC

                #8
                Re: Image show with javascript

                Thanks very much. but I am totally new to javascript. Can you please
                explain which is the bit to put in the main page to control the frame.
                I supoose the one you wrote was for the frame page.

                Where is the reference to the text1,text2...? I want the viewer to
                click text1 and see pic1 in the frame, click text2 and the frame will
                instantly change to pic2.

                Thanks

                On Tue, 04 Jan 2005 13:48:23 GMT, "McKirahan" <News@McKirahan .com>
                wrotd:[color=blue]
                >Will this help? Watch for word-wrap.
                >
                ><html>
                ><head>
                ><title>iframed .htm</title>
                ><script type="text/javascript">
                >var pix = new Array();
                > pix[0] = "http://www.fontstuff.c om/images/fptut17a_small. jpg";
                > pix[1] = "http://www.fontstuff.c om/images/fptut17b_small. jpg";
                > pix[2] = "http://www.fontstuff.c om/images/fptut17c_small. jpg";
                >function pic(t) {
                > document.all.i. src = pix[t];
                >}
                ></script>
                ></head>
                ><body>
                ><center>
                ><a href="javascrip t:pic(0)">Pictu re 1</a> |
                ><a href="javascrip t:pic(1)">Pictu re 2</a> |
                ><a href="javascrip t:pic(2)">Pictu re 3</a>
                ><br><br>
                ><iframe name="i" align="center"
                > frameborder="0" scrolling="no"
                > marginwidth="0" marginheight="0 "
                > style="width:15 0; height:112"></iframe>
                ><br><br>
                ><sup><a href="http://www.fontstuff.c om/frontpage/fptut17.htm"
                >target="_blank ">Making a Browser Window Fit an Image</a></sup>
                ><center>
                ></body>
                ></html>
                >[/color]


                ABC
                Do not reply by email. Replay to NG

                Comment

                Working...