First web site - need help with javascript

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

    First web site - need help with javascript

    Hi,
    I'm in the process of designing a web site for my wedding. This is my
    first attempt at web design of any sort. I have the basic design done
    and I am now at the point where I want to start adding some content. I
    am having a problem with one page, the URL is:



    The left hand side will be link and I want the content to be displayed
    in the main area. So for example, when someone clicks on ceremony, the
    information on the ceremony will be displayed etc etc. I'd like to try
    and do this with out creating a separate page for each menu item. Is
    this possible, if so can some one give me some instructions.

    Thanks
  • Reply Via Newsgroup

    #2
    Re: First web site - need help with javascript

    Peter Jones wrote:
    [color=blue]
    > Hi,
    > I'm in the process of designing a web site for my wedding. This is my
    > first attempt at web design of any sort. I have the basic design done
    > and I am now at the point where I want to start adding some content. I
    > am having a problem with one page, the URL is:
    >
    > http://www.peterj1974.plus.com/weddingdetails.htm
    >
    > The left hand side will be link and I want the content to be displayed
    > in the main area. So for example, when someone clicks on ceremony, the
    > information on the ceremony will be displayed etc etc. I'd like to try
    > and do this with out creating a separate page for each menu item. Is
    > this possible, if so can some one give me some instructions.
    >
    > Thanks[/color]

    As a quick answer I would think you would not have to use javascript to
    get where you want to go - Instead, you could use an IFRAME to the right
    of your menu - Give it a name (for example, call it WORKAREA) then, use
    TARGET=WORKAREA in your links on the right...

    Does that help you any?

    randelld

    Comment

    • kaeli

      #3
      Re: First web site - need help with javascript

      In article <6e177c2d.04041 91049.183dcecf@ posting.google. com>,
      petejones1974@h otmail.com enlightened us with...[color=blue]
      > Hi,
      > I'm in the process of designing a web site for my wedding. This is my
      > first attempt at web design of any sort. I have the basic design done
      > and I am now at the point where I want to start adding some content. I
      > am having a problem with one page, the URL is:
      >
      > http://www.peterj1974.plus.com/weddingdetails.htm
      >
      > The left hand side will be link and I want the content to be displayed
      > in the main area. So for example, when someone clicks on ceremony, the
      > information on the ceremony will be displayed etc etc. I'd like to try
      > and do this with out creating a separate page for each menu item. Is
      > this possible, if so can some one give me some instructions.
      >[/color]

      Sure, assuming supporting recent DOM browsers such as IE and Netscape 6+
      are sufficient for this personal site.

      Make a div and give it an ID.
      <div id="main"></div>

      When someone clicks a link, call a javascript function that writes the
      appropriate content to the div.
      <a href="#" onClick="writeC ontent('Ceremon y');return false;">Ceremon y
      </a>

      The innerHTML property should suffice if we're keeping this simple.

      (watch for word wrap)

      function writeContent(wh ich)
      {
      if (document.getEl ementById)
      {
      if (which == 'Ceremony')
      {
      document.getEle mentById("main" ).innerHTML = "some string of text
      etc";
      }
      else if (which == 'Reception')
      {
      document.getEle mentById("main" ).innerHTML = "some other string of
      text etc";
      }
      }
      }

      You can get fancy by storing the values for the various links in an
      array and referencing that instead. It's easier to modify, but a tad
      more complicated to "get" if you're new to programming.

      HTH

      --
      --
      ~kaeli~
      Those who get too big for their britches will be exposed in
      the end.



      Comment

      • Dennis M. Marks

        #4
        Re: First web site - need help with javascript

        In article <6e177c2d.04041 91049.183dcecf@ posting.google. com>, Peter
        Jones <petejones1974@ hotmail.com> wrote:
        [color=blue]
        > Hi,
        > I'm in the process of designing a web site for my wedding. This is my
        > first attempt at web design of any sort. I have the basic design done
        > and I am now at the point where I want to start adding some content. I
        > am having a problem with one page, the URL is:
        >
        > http://www.peterj1974.plus.com/weddingdetails.htm
        >
        > The left hand side will be link and I want the content to be displayed
        > in the main area. So for example, when someone clicks on ceremony, the
        > information on the ceremony will be displayed etc etc. I'd like to try
        > and do this with out creating a separate page for each menu item. Is
        > this possible, if so can some one give me some instructions.
        >
        > Thanks[/color]

        The easiest way would be to modify your table so there is a cell where
        you want the pages to appear. In this cell create an <iframe
        id="frameName"> </iframe>. This will act as a window. On the left create
        <a href=xxx target="frameNa me">xxx</a>.

        Use CSS to set the size of the iframe.

        There are other methods, such as using innerhtml, which others will be
        sure to show you.

        ..

        --
        Dennis M. Marks

        Replace domain.invalid with dcsi.net


        -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
        http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
        -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

        Comment

        Working...