SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    expression() for Netscape/Mozilla?

    Hi Guys

    I have been looking and looking to no avail.

    IE has had, since IE4, the use of:
    expression( [function or script expression])
    within a style block declaration to dynamically set the value of a css property.
    Does Netscape v6+ and/or mozilla have anything of the sort?
    Code:
    <style type="text/css">
     div{position:absolute;
    top:expression((document.documentElement.offsetHeight * 0.15) + 'px');}
    </style>
    Cheers,

    Keith

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The inclusion of JavaScript into CSS ("behaviors" as MS calls them) are proprietary to IE. And in true MS fashion, they've got a few patents on it, so this feature won't be finding its way into any other browsers any time soon.
    ----Adopt-a-Sig----
    Your message here!

  3. #3
    SitePoint Member
    Join Date
    Oct 2001
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Randem

    No, this is not behaviors which have been around since IE5 but expression, which has been in use since IE4 and can be used with in a function or within css to declare a script expression or function.
    Cheers,

    Keith

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Asking everywhere but your home forums, eh Diades? What does that imply about JavascriptCity?
    Jason - Contact Me
    Supermoderator @ CodingForums

  5. #5
    SitePoint Member
    Join Date
    Oct 2001
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Marks for observation zero I am afraid At least I dont go around mislaying files though
    Cheers,

    Keith

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by diades
    Marks for observation zero I am afraid
    You don't expect me to dig through posts 2 days ago at JSC, do you? (All 5 of them from then to now - well, slight exaggeration). hehe
    Jason - Contact Me
    Supermoderator @ CodingForums

  7. #7
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think Microsoft have a patent on behaviours specifically to prevent them from being used in other browsers - for one thing they submitted bahviours to the W3C for consideration as an official standard, plus Mozilla has identical (but more advanced) support for attaching javascript to elements using CSS in the form of XBL, the XML Binding Language.

    Expression has always been an IE only thing, and is very unlikely to ever be included in the official CSS spec. Besides, it's a bit of a hack

  8. #8
    SitePoint Member
    Join Date
    Oct 2001
    Location
    UK
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Besides, it's a bit of a hack
    But such a nice one

    BTW, jkd suggested investigating "watch" and it does the trick. Not as simple as useing expression but at least it works.
    Cheers,

    Keith

  9. #9
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    for one thing they submitted bahviours to the W3C for consideration as an official standard, plus Mozilla has identical (but more advanced) support for attaching javascript to elements using CSS in the form of XBL, the XML Binding Language.
    See the behavioral extensions to CSS3:
    http://www.w3.org/TR/becss
    Which currently looks like a space filler to me, as some of it looks like Spice (a W3C Note), and IE's MSDN behavior reference.

    XBL is a W3C Note as well, but not mentioned in that spec. I would much prefer the behavioral extension to CSS3 look more like XBL than ViewLink behaviors. Of course, the main issue with XBL (no global namespace!) would have to be fixed by the incorporation of <script> tag or something.
    Jason - Contact Me
    Supermoderator @ CodingForums

  10. #10
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, that's Microsoft's submission. As far as I can tell that only ever made it to the "proposed" phase, while XBL was accepted as a "W3C Note". For what it's worth, the differences between the two are explained here: http://www.w3.org/TR/#About

  11. #11
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    I don't think Microsoft have a patent on behaviours specifically to prevent them from being used in other browsers
    The patent isn't taken to preven the feature being used in other browsers... it is taken to protect "intellectual property" which in english means "so Microsoft can make a buck." The reason this precludes other browsers from using the feature is because since Netscape, Mozilla, etc., do not charge for their browsers, they really can't justify paying a licensing fee to Microsoft in return for using their patented technology.
    ----Adopt-a-Sig----
    Your message here!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •