简体   繁体   English

将DIV(滑块)调整为屏幕尺寸

[英]Resize DIV (Slider) to screen size

I have a slider that is finished, but I have 1 issue. 我有一个完成的滑块,但是有1个问题。 I need to re-size the container to the windows size. 我需要将容器调整为Windows大小。

As you can see here 正如你可以看到这里

jQuery(document).ready(function(){
   $(".toggle_window").click(function(){
       $("#content").slideToggle("slow");
   });
});

the slider disappear and I dont have any change to press the button so collapse the container again. 滑块消失,我没有任何改变可按下按钮,因此请再次折叠容器。 The problem I think is here #left and the high of this (height: 880px;), but I need to expand this guy at 95% of the webpage. 我认为问题出在这里#left及其高度(高度:880px;),但是我需要在95%的网页上扩展此人。

Which will be the best way to re-size the container? 哪种方法是调整容器大小的最佳方法?

I will appreciate your help. 感谢您的帮助。

Thnx in advance! 提前thnx!

Cheers. 干杯。

element #left height is set wrongly in your fiddle. 在您的小提琴中错误地设置了元素#left高度。 Try setting the element height on document ready as 尝试将文档上的元素高度设置为

 $("#left").height($( window ).height() - $("footer").position().left + 10);

If you want exactly 95% try like this, 如果您想要95%的人尝试这样,

$("#left").height($(window).height() /100 * 95 - $("footer").position().left);

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

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