making a div id disappear

Discussion in 'HTML' started by ZigZag Life, Aug 12, 2009.

  1. ZigZag Life

    ZigZag Life Guest

    hi guys,

    i'm using dw/cs3 for a template driven small site.

    the top and bottom nav bars are locked into a template, as well as
    center-justified 'home page' links extreme top and bottom
    of the page.

    the nav bars, and the 'home page' links are each positioned
    by unique DIV ID identifiers.

    i would like to somehow make the "home page" link
    disappear on the actual home page, but since it's
    locked into the same template as other pages,
    i can't seem to.

    is there any kind of scripting i could embed in the template header
    that might render the 'home page' link DIV invisible, but only
    on the "index.htm" page?

    thanks for any suggestions ('m not a javascripter or php guy,
    else i might be able to cook 1 up myself!!)

    Gzag
     
    ZigZag Life, Aug 12, 2009
    #1
    1. Advertising

  2. On Aug 11, 9:08 pm, "ZigZag Life" <> wrote:
    > hi guys,
    >
    > i'm using dw/cs3 for a template driven small site.
    >
    > the top and bottom nav bars are locked into a template, as well as
    > center-justified 'home page' links extreme top and bottom
    > of the page.
    >
    > the nav bars, and the 'home page' links are each positioned
    > by unique DIV ID identifiers.
    >
    > i would like to somehow make the "home page" link
    > disappear on the actual home page, but since it's
    > locked into the same template as other pages,
    > i can't seem to.
    >
    > is there any kind of scripting i could embed in the template header
    > that might render the 'home page' link DIV invisible, but only
    > on the "index.htm" page?
    >
    > thanks for any suggestions ('m not a javascripter or php guy,
    > else i might be able to cook 1 up myself!!)
    >
    > Gzag


    Posting a link to your page is traditional and helpful.

    Try adding style="visibility: hidden" to the elements that you want to
    hide.

    Herbert
     
    Herbert Blenner, Aug 12, 2009
    #2
    1. Advertising

  3. ZigZag Life

    John Hosking Guest

    On Wed, 12 Aug 2009 01:08:42 GMT, ZigZag Life wrote:

    >
    > the top and bottom nav bars are locked into a template, as well as
    > center-justified 'home page' links extreme top and bottom
    > of the page.
    >
    > the nav bars, and the 'home page' links are each positioned
    > by unique DIV ID identifiers.


    Ick. I wonder what happens when a visitor resizes their text.

    >
    > i would like to somehow make the "home page" link
    > disappear on the actual home page, but since it's
    > locked into the same template as other pages,
    > i can't seem to.
    >
    > is there any kind of scripting i could embed in the template header
    > that might render the 'home page' link DIV invisible, but only
    > on the "index.htm" page?
    >
    > thanks for any suggestions ('m not a javascripter or php guy,
    > else i might be able to cook 1 up myself!!)
    >


    The following mangles the nav menu as you requested, causing the link to
    completely disappear on the same page it would point to. I think this is a
    bad idea, because the menu changes from page to page (something different
    missing on each page, possibly with nav links jumping around as the user
    navigates around).

    You could add something like <body class="home">, <body class="contact">,
    etc. on each of your pages, with markup like this for the navbar (adapt to
    match your existing markup, which I can't do, not having seen your URL):

    <ul>
    <li class="home"><a href="index.htm">Home</a></li>
    <li class="prods"><a href="products.htm">Products</a></li>
    <li class="about"><a href="team.htm">Our Company</a></li>
    <li class="contact"><a href="contact.htm">Contact Us!</a></li>
    </ul>

    Then you use this CSS:

    body.home li.home { visibility:hidden; }
    body.prods li.prods { visibility:hidden; }
    body.profile li.about { visibility:hidden; }
    body.contact li.contact { visibility:hidden; }

    Again, I think this is the messy way, because the links disappear/appear on
    various pages. Cleaner is to use a preprocessor using, say, PHP with a
    class indicating the current page followed by common code to insert (or
    not) the <a> link, while the text itself "Home" is always inserted. But if
    you're not ready to do PHP I don't know what to suggest.


    --
    John
     
    John Hosking, Aug 12, 2009
    #3
  4. ZigZag Life

    Neredbojias Guest

    On 11 Aug 2009, "ZigZag Life" <> wrote:

    > hi guys,
    >
    > i'm using dw/cs3 for a template driven small site.
    >
    > the top and bottom nav bars are locked into a template, as well as
    > center-justified 'home page' links extreme top and bottom
    > of the page.
    >
    > the nav bars, and the 'home page' links are each positioned
    > by unique DIV ID identifiers.
    >
    > i would like to somehow make the "home page" link
    > disappear on the actual home page, but since it's
    > locked into the same template as other pages,
    > i can't seem to.
    >
    > is there any kind of scripting i could embed in the template header
    > that might render the 'home page' link DIV invisible, but only
    > on the "index.htm" page?


    if (location.href.indexOf("home_page")>-1) document.getElementById
    ("home_page_link_id").style.visibility="hidden";

    > thanks for any suggestions ('m not a javascripter or php guy,
    > else i might be able to cook 1 up myself!!)
    >
    > Gzag
    >
    >




    --
    Neredbojias
    http://www.neredbojias.org/
    http://www.neredbojias.net/
     
    Neredbojias, Aug 12, 2009
    #4
  5. ZigZag Life

    ZigZag Life Guest

    "John Hosking" <> wrote in message
    news:...
    > On Wed, 12 Aug 2009 01:08:42 GMT, ZigZag Life wrote:
    >
    >>
    >> the top and bottom nav bars are locked into a template, as well as
    >> center-justified 'home page' links extreme top and bottom
    >> of the page.
    >>
    >> the nav bars, and the 'home page' links are each positioned
    >> by unique DIV ID identifiers.

    >
    > Ick. I wonder what happens when a visitor resizes their text.
    >
    >>
    >> i would like to somehow make the "home page" link
    >> disappear on the actual home page, but since it's
    >> locked into the same template as other pages,
    >> i can't seem to.
    >>
    >> is there any kind of scripting i could embed in the template header
    >> that might render the 'home page' link DIV invisible, but only
    >> on the "index.htm" page?
    >>
    >> thanks for any suggestions ('m not a javascripter or php guy,
    >> else i might be able to cook 1 up myself!!)
    >>

    >
    > The following mangles the nav menu as you requested, causing the link to
    > completely disappear on the same page it would point to. I think this is a
    > bad idea, because the menu changes from page to page (something different
    > missing on each page, possibly with nav links jumping around as the user
    > navigates around).
    >
    > You could add something like <body class="home">, <body class="contact">,
    > etc. on each of your pages, with markup like this for the navbar (adapt to
    > match your existing markup, which I can't do, not having seen your URL):
    >
    > <ul>
    > <li class="home"><a href="index.htm">Home</a></li>
    > <li class="prods"><a href="products.htm">Products</a></li>
    > <li class="about"><a href="team.htm">Our Company</a></li>
    > <li class="contact"><a href="contact.htm">Contact Us!</a></li>
    > </ul>
    >
    > Then you use this CSS:
    >
    > body.home li.home { visibility:hidden; }
    > body.prods li.prods { visibility:hidden; }
    > body.profile li.about { visibility:hidden; }
    > body.contact li.contact { visibility:hidden; }
    >
    > Again, I think this is the messy way, because the links disappear/appear
    > on
    > various pages. Cleaner is to use a preprocessor using, say, PHP with a
    > class indicating the current page followed by common code to insert (or
    > not) the <a> link, while the text itself "Home" is always inserted. But if
    > you're not ready to do PHP I don't know what to suggest.
    >
    >
    > --
    > John


    thanks John. That's a unique and impressive plot! I often have thought it
    would be nice on vertically-stacked (ie left hand) nav bars, to have the
    "current" page show up as a muted BG color behind the link, kind-of ID'ing
    to the visitor what page they were on. This scheme of yours does lend
    itself to this protocol nicely.

    I did actually try Herbert's suggestion of adding visibility: hidden to the
    "home" div box, and it works admirably well.

    the one fall-back of the above method, is, not sure if I can un-hook the
    BODY attribute from DW's template system. meaning, making it an "editable
    region"

    ZZL
     
    ZigZag Life, Aug 13, 2009
    #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. Kyle James Matthews

    Putting image in <div> makes menu disappear!

    Kyle James Matthews, Apr 23, 2004, in forum: HTML
    Replies:
    2
    Views:
    1,779
  2. Claus Tondering

    Tkinter: Making a window disappear

    Claus Tondering, Oct 9, 2006, in forum: Python
    Replies:
    4
    Views:
    595
    Eric Brunel
    Oct 10, 2006
  3. Gnarlodious
    Replies:
    3
    Views:
    4,484
    Gnarlodious
    Dec 27, 2007
  4. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    814
  5. Hal Vaughan

    Making Form Elements Appear and Disappear

    Hal Vaughan, Dec 24, 2003, in forum: Javascript
    Replies:
    1
    Views:
    221
    Martin Honnen
    Dec 25, 2003
Loading...

Share This Page