Wednesday, October 12, 2011

After some fooling around got the twitter-bootstrap dropdown working. Some other people also faced the issue so posting it right here.

<html>
<head>
<script type="text/javascript" src="yourpath to jquery/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="iyour path to bootstrap js/bootstrap/bootstrap-dropdown.js"></script>
<link rel="stylesheet" href="your path to bootstrap css/bootstrap.min.css" type="text/css"/>
</head>
<body>
<div id="test-div">
    <ul class="tabs">
        <li class="active"><a href="">some link here</a></li>
        <li class="dropdown" data-dropdown="dropdown" >
            <a href="#" class="dropdown-toggle">DropDown</a>
            <ul class="dropdown-menu">
                <li><a href="#">Secondary link</a></li>
                <li><a href="#">Another link here</a></li>
            </ul>
        </li>   
    </ul>
</div>
</body>
<script>
    $(document).ready(function () {
                $('#test-div').dropdown();
                alert('all is well');
            });
</script>
</html>