473,769 Members | 1,803 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 1683
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
Jun 27 '08 #2

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

Similar topics

3
12822
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" href="ui/demo.css" ></link> in your XSL file, this link will always be relative to the location where the XML file is. For example, suppose I have following XML data (test.xml):
4
3319
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 */ /* styles/mystyles.css */ ..leftnav { font-family: Arial, Helvetica, sans-serif; font-size: 13pt;
6
1947
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 herself. For other sites I've done, I've titled the preferred screen stylesheet "default." However, this seems likely to cause confusion when I try to explain that css will suggestion a presentation different than the browser default. Thus,...
2
2823
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 Maintainer: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.15 ______________________________________________________________________
5
5784
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 ugly. SO, I am looking for a "cross browser" "general" stylesheet that can be apply to a general HTML page.
0
1960
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: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.16 ______________________________________________________________________
14
24240
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". This all works in Internet Explorer, but doesn't work with Firefox. In both IE and Firefox this works: <?xml-stylesheet type="text/xsl" encoding="UTF-8" href="makehtml.xslt" version="1.0"?>
3
1347
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
1818
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 of the css, you see the same banner no matter what styesheet you choose. Is there a way to change the flash image upon switching the stylesheet? or a way to embed flash code within a css stylesheet? Thank you :)
4
4155
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 then the grand total. It has two lines of twenty characters in flourescent blue or green. These particular displays are IBM part number 61P5766. They are beautiful displays, highly readable and from what I understand are very reliable. I would...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.