Grow your CSS skills. Land your dream job.

Jquery .CSS skew attribute

  • # May 20, 2013 at 10:28 pm

    i know how to apply CSS styles with Jquery but how would be able to style CSS3 Skew? for example

    $(“div”).css(“-webkit-transform”:”skew(0deg)”);

    That doesnt work and it’s because of the parenthesis. But how would i write it then? and i know that’s for multiple elements. I just wrote it like that because that’s what im doing.

    # May 21, 2013 at 7:42 am

    , instead of :

    $(“div”).css(“-webkit-transform”, “skew(10deg)”);

    or Object syntax

    $(“div”).css({webkitTransform: “skew(10deg)”});

    `$(‘div’).css(“webkitTransform”, “skew(10deg)”);` also works, or this:

    $(‘div’).each(function() {
    this.style.webkitTransform = ‘skew(10deg)';
    });

    or without jQuery

    var divs = document.getElementsByTagName(‘div’);
    for (var i = 0; i < divs.length; i++) {
    divs.style.webkitTransform = ‘skew(10deg)';
    }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".