Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS how to Get window Object in CSS

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #149018
    jim201
    Participant

    Greeting how can I access the Window object in CSS , I need to Get the document.documentElement.scrollHeight and document.documentElement.scrollWidth in CSS and I cant use the CSS expression since its Supported since IE10 is it possible thanks in Advance

    #149022
    Paulie_D
    Member

    Pretty sure you can’t…that’s what JS is for.

    #149038
    Eric Gregoire
    Participant

    Could you provide more info on what you’re trying to achieve?

    #149144
    jim201
    Participant

    I am trying to make web Application Compatible with IE 10 and Chrome
    now i found some Classes in CSS file that Use expressions such as
    .modalDialogDiv{
    filter:alpha(opacity=55);
    opacity:0.55;
    background-color:transparent/#333333;
    align:center;
    z-index:1;
    vertical-align:middle;
    height : expression(document.documentElement.scrollHeight);
    width : expression(document.documentElement.scrollWidth);
    z-index: 1;
    left: 0px;
    top: 0px;
    position:absolute;
    }

    this class for example is used to Display a Transparent Div all over the page after user Save and Display some info in the Meddle of the Div

    i am trying not keep changes to CSS and avoid altering Code as much as i can

    thanks

    #149152
    Paulie_D
    Member

    Something learned every day

    Dynamic properties (also called “CSS expressions“) are no longer supported in Internet Explorer 8 and later, in IE8 Standards mode and higher. This decision was made for standards compliance, browser performance, and security reasons, as detailed in the IE blog entry titled Ending Expressions. Dynamic properties are still available in Internet Explorer 8 in either IE7 mode or IE5 mode.

    #149161
    Eric Gregoire
    Participant

    It looks like you’re just filling the width and the height of the document, right? You could get rid of the width and height values and just add

    bottom:0;
    right:0;

    which will stretch the element to the size of the screen when absolutely positioned? I could see an issue with there not being a pixel height for the vertical alignment to work, but if you know the height and width of the info going in the middle, it’s an option to set (on the information) the left margin to negative half the width and the top margin to negative half the height with it absolutely positioned 50% from the top and left.

    I’m also a bit confused by

    background-color:transparent/#333333;

    You can just use the #333333 color value and the opacity values will take care of the transparency.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.