bootstrap dropdown open on pageload

一世执手 提交于 2019-12-01 11:51:48

This little bit of jQuery script (I'm assuming you've loaded it becasue you're using Bootstrap) ought to do the trick. Once the DOM has loaded, it sends a click() to the dropdown toggle button.

$(document).ready(function () {
    $("#posuvnik").click();
});

There is probably a way to do it in straight CSS, but without seeing more of your code it's hard to know.

The dropdown is toggled with having the additional class 'open' added to the enclosing <li> element. So if you want to have it open on page loading:

<li class="dropdown open">

That will do the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!