jquery改变全宽到盒装布局 [英] jquery changing fullwidth to boxed layout

查看:58
本文介绍了jquery改变全宽到盒装布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用引导程序,并使用容器类来获得盒装布局(中间的所有内容)。我想制作一个网站,当用户点击一个按钮时,该网站会变成全宽。我怎么做到这一点?

i am using bootstrap and with the container class i get a boxed layout (all the content in the middle). i want to make a website which changes to fullwidth when a user clicks on a button. how can i do it?

我试过了jquery remove方法。

i tried jquery remove method.

<script>
    $( "button" ).click(function() 
        {
            $( ".container" ).remove();
    }
    );
</script>

但是它会使用.container类去除div内的所有内容。

but it removes everything inside the divs with .container class.

推荐答案

我想你想改变容器宽度到像网页一样完整。在这种情况下,试试这个

I think you want to change container width to full like web page. In this case try this one

<script>
    $("button").on('click',function(){
           $(".container").css({"width":"100%","height":"100%"});
    });
</script>

这篇关于jquery改变全宽到盒装布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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