How do I go about having a text link direct the viewer to the part of the same page where that specific information can be found so that viewers do not have to do a lot of scrolling before reaching the desired info? Thanks.
Use an “anchor”.
Use the code
<a name=“top”></a>
to identify the section.
Then use
<a href=“#top”>link to top</a>
to link to that particular section.
“top” can be re-named anything you wish.
Named anchors are an old technique that is easily confused with named form elements, and in-page links must be unique.
That is why a unique identifier should be used instead.
For example:
<a href="#details">more details</a>
...
<h2 id="details">Details</h2>
Though anchors have the advantage of bringing the keyboard focus along with visual focus in browsers who do it wrong like Safari (unless recent versions have fixed this?).
Meaning the next TAB the user hits starts from the visual focus, not the top of the page or somewhere.
A nice thing to do if you are linking to anchors/IDs within a page is to use the Smooth Scroll script. Normally if you click on an in-page link, the browser just jumps straight there, which can be a bit confusing and disorientating - some people may not realise that anything has happened, because it happens so quickly, and others might not realise that they are still on the same page but looking at a different bit of it. What Smooth Scroll does is to ‘roll’ the page to the right place, which is a nice visual effect, and also communicates to the reader exactly what is happening, which can help them continue to navigate around the site/page as well as find their way back.
Smooth scrolling is not always a nice effect. The Smooth Scroll example can produce visually disturbing flickering/strobing. I’d not use this in a situation where there were many small items to be scrolled through rapidly. If there were a smaller number of larger items then using with a slower scroll speed would be more acceptable. Even then, not everyone will consider the movement a pleasing effect. Alternatively, we can inform the user that the target of the links are on the same page: an “On this page” heading, for example. Including links back to the top or to the in-page link list also tend to reduce disorientation.
Much less the train wreck it is on slow script browsers like IE and FF on lesser hardware like netbooks and nettops.
My MSI Wind U123, which is a pretty decent rig, HATES those types of stupid scripting tricks where it shoots up to 100% CPU just trying to do that as the page scroll turns into a slideshow.
I’d warn people that there was a scrolling effect, and maybe even a button where they can turn it off. I know people who get dizzy and nauseous from automatic scrolling (the browser frame being still and the stuff inside moving).
Similarly effects like this make people sick as well: http://perldoc.perl.org/index-functions.html (javascript on, a little grey menu stays at the top of the page) mostly because on some browsers it doesn’t stay as stable as the browsers’ top menu bar (if it did it would probably be ok).
I’m just laughing at the broken layout with the dividers for each letter overlapping said letter, the search box being bigger than the graphic, the breadcrumbs overlapping the title below it… apparently nobody bothered telling them that when the fonts get bigger, their PX placement gets screwed up. (No, really?)
But then with the whole “WCAG what’s that?” attitude of said page… Oh wait, it’s Perl. Duh.
But then with the whole “WCAG what’s that?” attitude of said page… Oh wait, it’s Perl. Duh.
No, it’s not Perl, it’s the guy who built that page shouldn’t be building web pages.
Notice the search does not work at all without Javascript enabled… his argument was something like, “I need JS because the pages are flat files” or something.
The page is very rigid and brittle. The contrast is low in many places.
I’m just laughing at the broken layout with the dividers for each letter overlapping said letter, the search box being bigger than the graphic, the breadcrumbs overlapping the title below it…
Everything pops out of its box on my browsers as well.
But Perl is not to blame. It’s unfortunate though that this is the official online perldocs documentation.
Give the guy a break, he’s still getting ready to transition from HTML 3 to HTML 4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
He’ll make the transition at some stage shortly. It’s only been 11 years since HTML4 came out.
BWAHAHAAA
Thanks, I needed a good laugh.
He’ll make the transition at some stage shortly.
I wish. This was a rewrite… it’ll probably stay this way for another 10 years.
… and let me guess, a huge fan of HTML5? that is their target audience after all, all the people still sleazing out HTML 3.2 with a HTML 4 tranny doctype on it.
Well the site maintainer, Jon Allen (at bottom of PERL page), is also a web designer so he’s got to keep up with the times.
There’s keeping up and there’s jumping the gun before it’s ready…
… and there’s when ‘new for new’s sake’ is just idiocy – which is HTML5 in a nutshell. NOT ready for primetime, NOT recommended for use in making websites, NOT introducing any USEFUL new functionality, and in fact setting HTML coding practice BACK a decade to the same sleaze it out any old way crap that HTML 3.2 was.
Anyone can call themselves a web developer. They can have paying clients. This does not mean they know what good front-end coding is.
and let me guess, a huge fan of HTML5?
I don’t get it. The page isn’t HTML5.
I don’t see Perl people as huge fans of HTML5.
It’s inferring the target audience of the HTML5 idiocy is NOT anyone who actually embraced STRICT, and instead as I said keeps sleazing out HTML 3.2 in lower case with a HTML 4 tranny doctype on it.
I’m pretty sure they’ll stick with Tranny. HTML5 is too hip : )
Not sure about those maintaining modules like HTML::Mason or HTML::Template or Template::Toolkit though. Though they should be able to do HTML5 fine. They’re just templates, after all.
I think that this horse has been beaten to a pulp now. We should finish up this thread now before habeas corpus is invoked.