473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jun 27 '08 #1
1 1662
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/
cssNoFrameStyles.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
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12802
by: allard poldermans | last post by:
How can I make a reference to an external CSS or JS file that is relative to the XSL stylesheet, and not relative to the XML data? If you simply put : <link rel="stylesheet" type="text/css"...
4
3284
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
6
1922
by: Brian | last post by:
A question of minutiae: I will soon develop a site for a business. I hope to provide the client with enough knowledge about css and html that she can take it over when it's done and maintain it...
2
2803
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
5
5772
by: HchC | last post by:
Not looking for a special or fancy css stylesheet. For a HTML beginner, stylesheet is still far away from now. Not even said thinking about cross browser. But, an XHTML page without stylesheet look...
0
1941
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
14
24186
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". ...
3
1323
by: mehul raval | last post by:
hi , regarding ur query as to print the individual elements here is the poss way to do it. # include <stdio.h> void main() { int (*Data); int A={1,2,3,4}; Data=&A;
2
1791
by: GloStix | last post by:
It's kind of an odd question but I have css stylesheet switcher on my website and it works and everything except since the flash banner I have is part of the html and the static image banner is part...
4
4132
by: Robert Wells | last post by:
I have four IBM POS VFD Customer Displays aka "Pole Displays" This is the one attached to various IBM electronic cash registers that shows the customer the price of each item as it is rung up and...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.