Using table or Layer (DIV)?

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

    #1

    Using table or Layer (DIV)?

    Hi

    I am trying to create an interactive links. I am not sure if I should
    use table or Layer (DIV) to display picture or text within either a
    table cell or a Layer.

    If I click on link A, it would display an image or text in a window.
    Click on link B and a new image is displayed, replacing the previous
    image/text. All this is done without loading a new page.

    Note I don't want to use frames, and my host doesn't support
    database/php. Can I do this using JavaScript to these links?

    Thanks,

    Dan
  • kaeli

    #2
    Re: Using table or Layer (DIV)?

    In article <407930a9@dnews .tpgi.com.au>, phobus@hotmail. com enlightened
    us with...[color=blue]
    > Hi
    >
    > I am trying to create an interactive links. I am not sure if I should
    > use table or Layer (DIV) to display picture or text within either a
    > table cell or a Layer.
    >
    > If I click on link A, it would display an image or text in a window.
    > Click on link B and a new image is displayed, replacing the previous
    > image/text. All this is done without loading a new page.
    >[/color]


    You need to support older browsers, or just the more recent ones like
    IE5+, netscape 6+, and Opera 6+?
    If supporting NN4, you'll need a special layer tag, otherwise, just use
    whatever you want, because you can change the src attribute of an image
    with JS.

    --
    --
    ~kaeli~
    Can you be a closet claustrophobic?



    Comment

    • Daniel

      #3
      Re: Using table or Layer (DIV)?

      kaeli wrote:[color=blue]
      > In article <407930a9@dnews .tpgi.com.au>, phobus@hotmail. com enlightened
      > us with...
      >[color=green]
      >>Hi
      >>
      >>I am trying to create an interactive links. I am not sure if I should
      >>use table or Layer (DIV) to display picture or text within either a
      >>table cell or a Layer.
      >>
      >>If I click on link A, it would display an image or text in a window.
      >>Click on link B and a new image is displayed, replacing the previous
      >>image/text. All this is done without loading a new page.
      >>[/color]
      >
      >
      >
      > You need to support older browsers, or just the more recent ones like
      > IE5+, netscape 6+, and Opera 6+?
      > If supporting NN4, you'll need a special layer tag, otherwise, just use
      > whatever you want, because you can change the src attribute of an image
      > with JS.
      >[/color]

      I am not very good with JavaScript. How would you do it?

      Comment

      • kaeli

        #4
        Re: Using table or Layer (DIV)?

        In article <407bde35@dnews .tpgi.com.au>, phobus@hotmail. com enlightened
        us with...[color=blue]
        > kaeli wrote:[color=green]
        > > In article <407930a9@dnews .tpgi.com.au>, phobus@hotmail. com enlightened
        > > us with...
        > >[color=darkred]
        > >>Hi
        > >>
        > >>I am trying to create an interactive links. I am not sure if I should
        > >>use table or Layer (DIV) to display picture or text within either a
        > >>table cell or a Layer.
        > >>
        > >>If I click on link A, it would display an image or text in a window.
        > >>Click on link B and a new image is displayed, replacing the previous
        > >>image/text. All this is done without loading a new page.
        > >>[/color]
        > >
        > >
        > >
        > > You need to support older browsers, or just the more recent ones like
        > > IE5+, netscape 6+, and Opera 6+?
        > > If supporting NN4, you'll need a special layer tag, otherwise, just use
        > > whatever you want, because you can change the src attribute of an image
        > > with JS.
        > >[/color]
        >
        > I am not very good with JavaScript. How would you do it?
        >[/color]

        How would *I* do it?

        Tested in IE6, NN7, and Opera 7. Won't work in NN4. Dunno about Safari,
        or IE Mac or other browsers, but it shouldn't kill anything.

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
        "http://www.w3.org/TR/REC-html40/loose.dtd">
        <html>
        <head>
        <title> test image switch </title>
        <script type="text/javascript">
        var imgArray = new Array("tri.gif" ,"tridown.gif", "trileft.gi f");
        function switchIt(num)
        {
        if (document.image s)
        {
        document.images["img_1"].src=imgArray[num];
        }
        }
        </script>
        </head>

        <body>
        <p>Click on the links to see the pics.</p>
        <p>
        <a href="#" onClick="switch It(0);return false;">default (0)</a><br>
        <a href="#" onClick="switch It(1);return false;">one</a><br>
        <a href="#" onClick="switch It(2);return false;">two</a><br>
        </p>
        <div>
        Image will appear here.<br>
        <img src="tri.gif" id="img_1" name="img_1">
        </div>
        </body>
        </html>

        Note: if you want to do text instead of images, it's quite a bit
        different.

        --
        --
        ~kaeli~
        Experience is something you don't get until just after you
        need it.



        Comment

        Working...