Qt World Summit: Register Today!

JS, CSS and Object

  • Hi

    I play a bit with a hybrid application and now I want to set css styles of the embedded widget (object) by js.
    I can set the visibility without problems by, but setting the opacity works only with the html element (table), not with the embedded widget. Why? What can I do? Any suggestions?

    <object id="object"> .... </object>
    <table id="table"> ...... </table>

    <!-- OK -->
    document.getElementById("object").style.visibility = "hidden";
    document.getElementById("object").style.visibility = "visible";

    <!-- doesn't work -->
    document.getElementById("object").style.opacity = "1";
    document.getElementById("object").style.opacity = "0.3";

    <!-- OK -->
    document.getElementById("table").style.opacity = "1";
    document.getElementById("table").style.opacity = "0.3";


Log in to reply