Opera won't change the style information when I change classname

Discussion in 'Javascript' started by torbs, May 1, 2006.

  1. torbs

    torbs Guest

    Hi

    I have two quicktime players. I load them like this:

    <object id="'movie" class="synligActiveXSpille" (...)
    <embed name="movie class="SynligSpiller (...)

    References to the two players are kept in the properties of the object
    ..loadingPlayer and .activePlayer.

    In the style sheet the class (u)synligActiveXSpiller changes only the
    z-index, while the (u)synligSpiller changes the visibility property.

    I have this callback function. The "thisElement" reference is simply
    the object (this):

    moviePlayer.prototype.switchPlayer = function (thisElement) {

    if (thisElement.activePlayer.className == "synligSpiller") {
    thisElement.activePlayer.className = "usynligSpiller";
    thisElement.loadingPlayer.className = "synligSpiller";
    thisElement.loadingPlayer.Stop();
    thisElement.loadingPlayer.Play();
    } else if (thisElement.activePlayer.className ==
    "synligActiveXSpiller") {
    thisElement.loadingPlayer.className =
    "synligActiveXSpiller";
    thisElement.activePlayer.className =
    "usynligActiveXSpiller";
    }

    var temp = [thisElement.activePlayer,
    thisElement.loadingPlayer];
    thisElement.loadingPlayer=temp[0];
    thisElement.activePlayer=temp[1];
    thisElement.movieLoaded=true;

    }

    After the function is finished the classnames have been changed, but
    the player do not change the visibility.

    It works in IE and Firefox.

    mvh
    Tor
    torbs, May 1, 2006
    #1
    1. Advertising

  2. torbs

    Guest

    Tor wrote:

    > thisElement.activePlayer.className = "usynligSpiller";
    > thisElement.loadingPlayer.className = "synligSpiller";


    >After the function is finished the classnames have been changed, but
    >the player do not change the visibility.


    >It works in IE and Firefox.


    I don't have Opera here, so I can't try this out, but try changing
    'class', as well as 'className'.

    Stan Scott
    New York City
    , May 1, 2006
    #2
    1. Advertising

  3. torbs

    torbs Guest

    Hi Stan

    Thank, but I had already done it. Changing 'class' was the only way to
    make opera change the class. It didnt understand changing of the
    'classname' property. As it turns out this problem is also a case with
    safari on mac. I have corrected the problem by creating some browser
    specific code, but I had to use browser detection rather than feature
    detection because both browsers claim to support visibility change of
    embedded objects. Browser detection is not a good thing...

    Agian thanks for the reply.

    mvh
    Tor
    torbs, May 2, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver S.

    classname::classname a type ?

    Oliver S., Sep 11, 2003, in forum: C++
    Replies:
    1
    Views:
    482
    White Wolf
    Sep 11, 2003
  2. Hongzheng Wang
    Replies:
    32
    Views:
    853
  3. Ante Perkovic

    CSS: "tagname.classname" or ".classname"

    Ante Perkovic, Dec 22, 2003, in forum: Javascript
    Replies:
    2
    Views:
    94
  4. dave
    Replies:
    0
    Views:
    106
  5. Supernaut
    Replies:
    1
    Views:
    117
    Thomas 'PointedEars' Lahn
    May 29, 2006
Loading...

Share This Page