CSS / JS / HTML:JS旋转整页的函数? [英] CSS/JS/HTML: JS Function to rotate full page?

查看:110
本文介绍了CSS / JS / HTML:JS旋转整页的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以对于我在网络课上的决定,我们只是应该做一个网站做我们去的地方。现在我已经完成了,并决定添加一些有趣的东西。

Okay, so for my final in a web class, we are just supposed to make a website do whatever we went. I'm done now and decided to add some fun stuff.

我想使用 -webkit-transform:rotate(-4deg) ;对身体。

I want to use -webkit-transform: rotate(-4deg); on the body.

我如何在javascript函数中这样做?

How can I do that in a javascript function? I have done it with the body background before, but I cannot get this to work.

这是我尝试过的:

function rotatepage() {
    document.body.style.-webkit-transform =  rotate(-90deg); 
}

function rotatepage() {
    document.body.style =  -webkit-transform:rotate(-90deg); 
}

任何想法?这是可能吗?

Any ideas? Is this possible?

推荐答案

今天我学习了

document.body.style.setProperty("-webkit-transform", "rotate(-90deg)", null);

小提琴

这篇关于CSS / JS / HTML:JS旋转整页的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆