I wrote some jQuery to target the list items (li) in my left nav bar. The jQuery works when I push the changes to Heroku, but the jQuery that I wrote doesn't work on the localhost. The effect that I'm aiming for is when the user mouses over the links in the nav bar, the links move to the right 2 em. I can't figure out why the jQuery works on the hosted site and not localhost. I have a feeling that it might have something to do with the application.js file. Any help would be greatly appreciated and thanks in advance!!!
// javascript assets
// = require jquery
// = require jquery_ujs
// = require turbolinks
// = require welcome.js
// = require_tree .
// the html
<div class="list-items">
<ul>
<li class="links"><%= link_to "Portfolio", portfolio_url %></li>
<li class="links"><%= link_to "Tutorials", tutorials_url %></li>
<li class="links"><%= link_to "Blog", blog_url %></li>
<li class="links"><%= link_to "About Me", aboutme_url %></li>
</ul>
</div>
// css for list items
.list-items {
font-size: 1.5em;
line-height: 2em;
margin-left: -.20em;
}
// JS for hovering over the link
$(document).ready(function() {
console.log("You are in the console right now!!");
$(".links").on("mouseenter", function() {
$(this).css("margin-left", "2em");
});
$(".links").on("mouseleave", function() {
$(this).css("margin-left", "-0.05em");
});
});