Previous Message
Next Message

Suckerfish:target technique and Opera

Sent by Paul Debban on 1 September 2005 17:05


I have stumbled onto a puzzle in Opera and was wondering if there was
a link that would explain the behavior.

In the test file <http://tinyurl.com/8snt2>, I am emulating the
:target pseudo class on the speaker name links by using a variation on
the Sons of Suckerfish:target approach where the className attribute
of the target id is changed when the link is clicked.

I had the stylesheet written as follows:

..HigherLevelContainerClass .GenericClassOfTarget:target, /* for
browsers supporting :target */
..HigherLevelContainerClass .current /* for others */
{
  style when target is current
}

This worked well in both FireFox and IE6, but did not work in Opera 8
(all on Windows XP).

After looking through the comments on the htmldog site, there was a
suggestion to remove all but the last selector and I found that if I
eliminated the unnecessary selectors, Opera 8 seemed happy.

..current /* for others */
 {
  style when target is active
}

However, I find that if I use a class name other than 'current' in the
JavaScript and stylesheet, Opera does not highlight the target.

I don't know if I have stumbled onto a hack or a key word by using the
class name of 'current' or if my approach is broken in some other way.

The page seems to be working now on Opera 8 (on my computer anyway),
but I don't understand why it is working with this combo of JavaScript
and CSS but not when I use other classnames. I would appreciate it if
someone could send a pointer to an explaination for this behavior.

---
Paul Debban
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message