anjlab / bootstrap-rails

Twitter Bootstrap CSS (with Sass flavour) and JS toolkits for Rails 3 projects
https://github.com/anjlab/bootstrap-rails
729 stars 96 forks source link

Javascript not working #2

Closed gavinhughes closed 12 years ago

gavinhughes commented 12 years ago

I'm on the current master branch I can't get the javascript to work. For testing I've got js slimmed down to this:

```<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>```

If I click on a dropdown, it doesn't respond to the click event. However, if I remove bootstrap-dropdown, and just add this:

$ -> $('.dropdown').click -> $(@).addClass('open')

it responds just fine. It's not just the dropdown js either, none of the bootstrap js files work.

Any ideas?

davidsulc commented 12 years ago

Hi, make sure you're adding the required attributes to the elements you want ot use js with (e.g. data-dropdown for dropdowns, per http://twitter.github.com/bootstrap/javascript.html#dropdown).

gavinhughes commented 12 years ago

Working now. Thanks.