Link Text With # Sends to Top of Page

I’m using the ScriptyAccordion action and I want my section caption text to change color when you roll over it, like a regular link, but it doesn’t really link to anything, so I’ve used #. The only thing is that when you click it to have the accordion drop down, the # jumps you to the top of the page. What can I do to keep that from happening?


Robin Stark

The ScriptyAccordion Action does not use link tags for the headers, it
uses JavaScript “click” observers. It does this for a particular
reason: if someone visits your site with JavaScript disabled, then
they see the entire accordion of data expanded, with nothing to clue
them in that they missed something or can’t see something. This is
called “unobtrusive scripting” and it’s a serious big deal. After all,
Google doesn’t run JavaScript and yet is bright enough to work out
that an element is hidden, and doesn’t index any hidden content.

So if you want to see a rollover effect in your headers, you’re going
to have to add it another way, without a link.

The simplest way to do this would be to add a new style to your Styles
palette. Let’s say you have an accordion set up in a box called item4,
and you’re using H3 tags for your headers. In your Styles palette,
click on the gear menu, choose Add Style, and enter #item4 h3:hover
in the Tag field. Next, tab into the Name field and delete whatever is
there, then TAB OUT AGAIN (very important, hence the shouting). Now
add your background-color or other highlight effect in the usual
manner and save the style. You will not need to apply this style to
anything. Through the magic of CSS, anyone (using a non-broken browser
(which is to say anything but IE) will see the rollover magic happen
when they mouse over an H3 tag in that particular DIV. IE users won’t
see anything special, but then again that’s nothing new for them.

Walter

On Jan 8, 2009, at 9:24 AM, Robin Stark wrote:

I’m using the ScriptyAccordion action and I want my section caption
text to change color when you roll over it, like a regular link, but
it doesn’t really link to anything, so I’ve used #. The only thing
is that when you click it to have the accordion drop down, the #
jumps you to the top of the page. What can I do to keep that from
happening?


Robin Stark


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Perfect. Thank you. I just checked it in IE7 and the rollover is
showing like it should, so that is truly magical.


Robin Stark

On Jan 8, 2009, at 8:45 AM, Walter Lee Davis wrote:

The ScriptyAccordion Action does not use link tags for the headers,
it uses JavaScript “click” observers. It does this for a particular
reason: if someone visits your site with JavaScript disabled, then
they see the entire accordion of data expanded, with nothing to clue
them in that they missed something or can’t see something. This is
called “unobtrusive scripting” and it’s a serious big deal. After
all, Google doesn’t run JavaScript and yet is bright enough to work
out that an element is hidden, and doesn’t index any hidden content.

So if you want to see a rollover effect in your headers, you’re
going to have to add it another way, without a link.

The simplest way to do this would be to add a new style to your
Styles palette. Let’s say you have an accordion set up in a box
called item4, and you’re using H3 tags for your headers. In your
Styles palette, click on the gear menu, choose Add Style, and enter
#item4 h3:hover in the Tag field. Next, tab into the Name field
and delete whatever is there, then TAB OUT AGAIN (very important,
hence the shouting). Now add your background-color or other
highlight effect in the usual manner and save the style. You will
not need to apply this style to anything. Through the magic of CSS,
anyone (using a non-broken browser (which is to say anything but IE)
will see the rollover magic happen when they mouse over an H3 tag in
that particular DIV. IE users won’t see anything special, but then
again that’s nothing new for them.

Walter

On Jan 8, 2009, at 9:24 AM, Robin Stark wrote:

I’m using the ScriptyAccordion action and I want my section caption
text to change color when you roll over it, like a regular link,
but it doesn’t really link to anything, so I’ve used #. The only
thing is that when you click it to have the accordion drop down,
the # jumps you to the top of the page. What can I do to keep that
from happening?


Robin Stark
Web Flunky
www.webflunky.com

Instant Messaging:
GoogleTalk: email@hidden
iChat: email@hidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options