making a div id disappear


Z

ZigZag Life

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
 
Ad

Advertisements

H

Herbert Blenner

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
 
J

John Hosking

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.
 
N

Neredbojias

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";
 
Ad

Advertisements

Z

ZigZag Life

John Hosking said:
Ick. I wonder what happens when a visitor resizes their text.


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.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top