Is it poss. to use alt. stylesheet switching and still bebookmark-friendly?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Rado

    Is it poss. to use alt. stylesheet switching and still bebookmark-friendly?

    Hi

    A while ago I discovered a way of creating css pseudo-frames, that
    offer users the important benefits of real frames (i.e. the navigation
    remains visible when you scroll down the page), but without most of
    the drawbacks (in particular, unlike real frames, this method is
    bookmarks-friendly and search engine-friendly). However, the method
    still has sufficient drawbacks from an accessibility point of view
    that I have been planning to provide an alternative stylesheet for
    users who prefer not to or can't use the default one. But to my
    dismay, I discovered today that the javascript that I had found to
    switch stylesheets is not bookmarks-friendly and I was hoping someone
    here might be able to think of a way of switching stylesheets that is.

    My plan was to make the stylesheet that uses "pseudo frames" the
    default if the user has javascript enabled, and to make the other
    stylesheet the default if the user has javascript disabled (for
    accessibility reasons). I planned to do this by making the "no pseudo
    frames" stylesheet the css default, and to then use a body onLoad
    statement to switch to the "pseudo frames" stylesheet when the page
    loads. But the style switching code that I found is not bookmarks-
    friendly.

    If you look at my mock-up at http://tinyurl.com/5ahkz2 , if you click
    on the link that says "See page 2, figure 1", it doesn't go to the
    bookmark, it goes to the top of the page - unless you click in the
    address bar after page 2 has loaded and press Return - then it does go
    to the bookmark, but my users would not be willing to put up with
    having to do that. On the other hand, if you disable javascript (which
    has the effect of making the "non pseudo frames" stylesheet the
    default), and in p1-switch.htm, if you click the same link again,
    then it does go straight to the bookmark. You can see the code that is
    doing the style switching if you view the source.

    To demonstrate that it is the style switching code that is causing the
    problem, I have created two additional mock-ups that don't use style
    switching code, but which simply load the "pseudo frames" stylesheet,
    with no alternative stylesheet on offer. If you look at the mock-up at
    http://tinyurl.com/5sargz , and if you click on the "See page 2,
    figure 1" link, then it does go straight to the bookmark.

    This discovery has been a real shock to me, as I have read several
    articles about using alternative stylesheets, and none of them have
    included any warning that doing so is not bookmarks-friendly. The
    bookmarks-friendliness of the site I'm developing is a lot more
    important to me than offering an alternative stylesheet is, although
    both are important.

    I should also add that my knowledge of javascript is very rudimentary,
    so if the workaround for this problem is at all complex, I'll need
    considerable hand holding; but the site I'm developing is non-
    commercial, is an extremely good cause, and I'm not being paid for
    doing it; so I do hope someone can help.

    Dave
  • Dave Rado

    #2
    Re: Is it poss. to use alt. stylesheet switching and still bebookmark-friendly?

    I've found a workaround - instead of using true alternative
    stylesheets, I'm now using the following, which works without any
    problems:

    <link rel="stylesheet " type="text/css" href="../StyleAndScripts/
    cssNoFrameStyle s.css" media="screen">

    <script type="text/javascript"><!--
    document.write( '<link rel="stylesheet " type="text/css" href="../
    StyleAndScripts/cssFrameStyles. css" media="screen"> ')
    //-->
    </script>


    It does have the disadvantage, though, that if you have javascript
    enabled, you can't use the alternative stylesheet. I can live with
    that, but if anyone can think of a bookmarks-friendly method of style
    switching, that would still be much better than the workaround I've
    come up with.

    Dave

    Comment

    Working...