Do I need javascript ?

Discussion in 'HTML' started by Chris Leonard, Feb 22, 2004.

  1. Hi.

    I'm building up a page which uses multiple divs to display information from
    a menu. As each menu item is 'clicked' I want the corresponding div to
    display.

    I've done something similar with JavaScript a long time ago but being new to
    CSS I wondered if it was possible without using JavaScript. I'm pretty sure
    I nedd to use some js as I understand CSS only provides the format, it
    doesn't "do" anything itself

    Anyone offer me some smart advice please on a way forward.

    Thanks in advance

    Chris
     
    Chris Leonard, Feb 22, 2004
    #1
    1. Advertising

  2. Chris Leonard

    Els Guest

    Chris Leonard wrote:

    > Hi.
    >
    > I'm building up a page which uses multiple divs to display information from
    > a menu. As each menu item is 'clicked' I want the corresponding div to
    > display.
    >
    > I've done something similar with JavaScript a long time ago but being new to
    > CSS I wondered if it was possible without using JavaScript. I'm pretty sure
    > I nedd to use some js as I understand CSS only provides the format, it
    > doesn't "do" anything itself
    >
    > Anyone offer me some smart advice please on a way forward.


    Not really smart advice, but why don't you make pages?
    Clickin on a link brings out the next page, which displays
    the corresponding div. As you make the pages otherwise
    identical, it 'looks just like javascript' ;-)

    If the div which is to be displayed is merely a 'tooltip' to
    the menu, you can include it in the link with a <span>, and
    have it display:none when not clicked, and display:block
    when clicked, using a:hover span{}.


    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Feb 23, 2004
    #2
    1. Advertising

  3. Chris Leonard

    Els Guest

    Els wrote:

    > If the div which is to be displayed is merely a 'tooltip' to the menu,
    > you can include it in the link with a <span>, and have it display:none
    > when not clicked, and display:block when clicked, using a:hover span{}.


    Oops, not true. It will display when hovered, not when clicked.
    Not sure if it can be made to stay after clicking it, with
    a:active maybe? And you probably want it to 'go away' when
    the next link is clicked, as well... :-(

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Feb 23, 2004
    #3
  4. Quoth the raven named Els:

    > If the div which is to be displayed is merely a 'tooltip' to the
    > menu, you can include it in the link with a <span>, and have it
    > display:none when not clicked, and display:block when clicked,
    > using a:hover span{}.


    Wouldn't it be easier to get the tooltip effect by using the title
    attribute, instead a a span? Assuming that will help the OP, of
    course, and I'm not quite certain what he is asking.

    <div title="Bunch of text that pops up when div is hovered">Whatever
    is in the div here...</div>

    --
    -bts
    -This space intentionally left blank.
     
    Beauregard T. Shagnasty, Feb 23, 2004
    #4
  5. Chris Leonard

    Andy Dingley Guest

    On Sun, 22 Feb 2004 23:50:18 +0000 (UTC), "Chris Leonard"
    <> wrote:

    >I wondered if it was possible without using JavaScript.


    Yes. try Eric Meyer's site for examples.
     
    Andy Dingley, Feb 23, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    2,499
    Edward
    Jun 18, 2004
  2. Teep
    Replies:
    2
    Views:
    782
    Larry Marburger
    Jun 21, 2004
  3. John
    Replies:
    1
    Views:
    424
    John C. Bollinger
    Aug 19, 2004
  4. francisco lopez
    Replies:
    2
    Views:
    280
    Hywel Jenkins
    Dec 30, 2004
  5. Jarrod Hyder

    Need a javascript guru (I need help!)

    Jarrod Hyder, Jan 27, 2005, in forum: Javascript
    Replies:
    1
    Views:
    91
Loading...

Share This Page