D
Dave Rado
Hi
My users would like to be able to see the menu and the footer
navigation in a website I'm building without first having to scroll to
the top or bottom the screen in order to get to them, which they find
irritating. I realise that suing frames is a no-no these days but I
was excited recently to discover a method using css "pseudo-frames"
that is bookmark-friendly and search engine friendly. However, I've
hit a snag. In order for the user to be able to navigate the
scrollable area using the keyboard without first clicking in that
area, I have to set the focus to the div that defines the scrollable
area. First I tried to do this using:
<body onload="document.getElementById('ScrollableContent').focus()">
That works perfectly in Firefox and IE but doesn't work in Safari or
Opera for some reason. See my mock-up at http://tinyurl.com/3bxktg..
I read somewhere that it is better to set the focus to an anchor
within a div rather than to the div itself, so I then tried creating
an anchor within the 'ScrollableContent' div, as in:
<a name="ContentLink" id="ContentLink"></a>
and then using:
<body onload="document.getElementById('ContentLink').focus()">
But that also works perfectly in Firefox and IE but doesn't work in
Safari or Opera for some reason. See my mock-up at http://tinyurl.com/38osgw.
Does anyone know (a) why Safari and Opera don't recognise
getElementById.focus()? and (b) whether there is any way of doing this
that does work in Safari and Opera?
Dave
My users would like to be able to see the menu and the footer
navigation in a website I'm building without first having to scroll to
the top or bottom the screen in order to get to them, which they find
irritating. I realise that suing frames is a no-no these days but I
was excited recently to discover a method using css "pseudo-frames"
that is bookmark-friendly and search engine friendly. However, I've
hit a snag. In order for the user to be able to navigate the
scrollable area using the keyboard without first clicking in that
area, I have to set the focus to the div that defines the scrollable
area. First I tried to do this using:
<body onload="document.getElementById('ScrollableContent').focus()">
That works perfectly in Firefox and IE but doesn't work in Safari or
Opera for some reason. See my mock-up at http://tinyurl.com/3bxktg..
I read somewhere that it is better to set the focus to an anchor
within a div rather than to the div itself, so I then tried creating
an anchor within the 'ScrollableContent' div, as in:
<a name="ContentLink" id="ContentLink"></a>
and then using:
<body onload="document.getElementById('ContentLink').focus()">
But that also works perfectly in Firefox and IE but doesn't work in
Safari or Opera for some reason. See my mock-up at http://tinyurl.com/38osgw.
Does anyone know (a) why Safari and Opera don't recognise
getElementById.focus()? and (b) whether there is any way of doing this
that does work in Safari and Opera?
Dave