简体   繁体   English

主体尺寸取决于jQuery的分辨率

[英]Body size depends on resolution jQuery

want to create a dynamic website using jQuery scroll to .My elements should be very spread. 想要使用jQuery滚动创建动态网站。我的元素应该非常广泛。 I want to put them into an absolute position. 我想把它们摆在绝对位置。

So what i want to do is that jQuery gets the window.width and height of the visitors screen . 所以我想做的就是jQuery获取访问者屏幕的window.width和height。 and multiplie the width*5 height*4 so my elements will be, where they belong. 并乘以width * 5 height * 4,这样我的元素就会属于它们所属的位置。 i can use a scroll to by anchor locallink # .. 我可以使用滚动来锚定本地链接#..

Yet I'm not very strong in js /jQuery thats why I need ur help ;-) 但是我在js / jQuery中不是很强,这就是为什么我需要您的帮助;-)

<script type="text/javascript">
        $(function(){
        var body_width = $('windows.width');
        $('body').body_width*5();

    });
</script>

Try with this: 试试这个:

var bWidth = $('body').width();
$('body').width(bWidth * 5);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM