如何为小型设备手动启用bootstrap响应式菜单

时间:2016-05-07 16:56:44

标签: javascript jquery twitter-bootstrap twitter-bootstrap-3

我想将默认ID名称从id="main-navbar"更改为From: <div id="navbar" class="navbar-collapse collapse"> To: <div id="main-navbar" class="navbar-collapse collapse">

    public  static void main(String[] args) {

    String html=null;

    //Descargamos el html
    String url = "http://www.opposingviews.com";
    Connection conn = Jsoup.connect(url);
    try {
        Response resp = conn.execute();
        if (resp.statusCode() != 200) {
            System.out.println("Error: "+resp.statusCode());
        }else{
            System.out.println(Thread.currentThread().getName()+" is downloading "+ url);
            //html = conn.get().html();
        }   
    }catch(IOException e) {
           System.out.println(e.getStackTrace());
           System.out.println(Thread.currentThread().getName()+"No puedo conectar con  "+ url);
           System.out.println("No se puede conectar");
    }

如果我更改,那么当您签入小型设备时,主导航/菜单项不会展开/折叠。如何手动启用此功能?请帮忙。

以下是我使用的bootstrap模板:https://getbootstrap.com/examples/navbar/

1 个答案:

答案 0 :(得分:2)

代码中有这个按钮: <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">

因此,您将data-target="#navbar"更改为data-target="#main-navbar"