Results 1 to 3 of 3

Thread: CSS3 and Javascript

  1. #1
    Join Date
    Dec 2010

    CSS3 and Javascript

    I'm having a hard time figuring this out.

    I'm trying to change the CSS property of an object. Lets say I am using skew:

    -moz-transform: skew(5deg);

    How do I reference that it's -moz-transform that I want to change? I can't use just transform itself because that is the standard, and most browsers haven't followed standards for transforms yet. So

    elementID.style.transform = skew(50deg);

    Does not work
    MY BLOG:
    HTML Code:
    <a href="http://teststuff.freehostingcloud.com">click here to read my game progress</a>

  2. #2
    Join Date
    Jan 2010
    You need to pass it as a string otherwise JavaScript will try and call it as a function
    elementID.style.transform = "skew(50deg)";

  3. #3
    Join Date
    Dec 2012
    To set browser specific styles do this

    elementID.style.MozTransform = "skew(50deg)";
    elementID.style.WebkitTransform = "skew(50deg)";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles