How do I rotate individual letters and keep them flowing left-to-right?

前端 未结 4 1695
天涯浪人
天涯浪人 2021-01-04 12:02

I am trying to get a string with each individual letter rotated 90 degrees; however, I want to keep the \"flow\" of letters going left-to-right, not vertical. I also want to

4条回答
  •  梦毁少年i
    2021-01-04 13:01

    Here's some js that should do the trick: http://jsfiddle.net/AYGDR/8/

    $(function() {
        $(".target").html(("" + $(".target").html().split(" ").join("") + ""));
        var rotate = 0;
        $(".target span").each(function() {
            rotate = rotate - 90
            $(this).css({
                "-webkit-transform": "rotate(" + rotate + "deg)",
                "display": "inline-block"
            });
        });
    });
    

    And I accidentally threw in some bonus shifting rotation since I imagined that was part of the question.

提交回复
热议问题