Twitter upload

Here is what my code looks like, but the problem is that: when I click on the minimized button (the one that has 4 horizontal lines), it does not open the first time I click, but only on the second click. The first click does nothing, and the second quickly opens it, which quickly closes it, than opens it again. Why is this and how to fix it?

 22     <!-- BOOTSTRAP NAVBAR -->
 23     <div class="navbar navbar-fixed-top">
 24       <div class="navbar-inner">        
 25         <div class="container">
 26 
 27           <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">                                                   
 28             <span class="icon-bar"></span>  
 29             <span class="icon-bar"></span>  
 30             <span class="icon-bar"></span>  
 31             <span class="icon-bar"></span>
 32           </a>
 33     
 34           <%= link_to 'Synergy', root_path, :class => 'brand' %>                                                                          
 35 
 36           <div class="nav-collapse">                                                                                            
 37 
 38             <% if current_user %>                                                                                                         
 39 
 40               <ul class="nav">
 41                 <li><%= link_to 'My projects', projects_path %></li>
 42                 <li><%= link_to current_user.name, '#' %></li>
 43                 <li><%= link_to 'Log out', destroy_user_session_path, :method => :delete %></li>
 44               </ul>        
 45 
 46             <% else %>     
 47 
 48               <ul class="nav">
 49                 <li><%= link_to 'Sign in', new_user_session_path %></li>
 50                 <li><%= link_to 'Sign up!', new_user_registration_path %></li>
 51               </ul>        
 52 
 53             <% end %>      
 54 
 55           </div>           
 56 
 57         </div>             
 58       </div>               
 59     </div>
 60     <!-- BOOTSTRAP NAVBAR -->

EDIT: this is my application.js file:

 13 //= require jquery
 14 //= require jquery_ujs
 15 //= require jquery-ui
 16 //= require twitter/bootstrap
 17 //= require_tree .
+3
source share
2 answers

It looks like you are downloading some JS files twice. It's easy to forget where the files are downloaded in Ruby or Grails.

Try turning on the jQuery call on the script page and place the inline script immediately after the call. An example would be the following:

<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap-carousel.js" type="text/javascript"></script>
<script src="js/bootstrap-transition.js" type="text/javascript"></script>
<script>

$(document).ready(function() {
    $('#myCarousel').carousel();
  });
</script>

script - Firebug . , jQuery . , :)

+1

- , , dev prod js .

rake assets:clean (rails3)/ rake assets:clobber (rails4) .

0

All Articles