jquery - How to make a page reload when it is visited -
i have rails app https://hr4d.herokuapp.com problem when visit new page, page doesn't load properly, makes jquery ineffective. can visit site, , see mean. here jquery:
$('document').ready(function() { $('.dropdown-services').hide(000); $('#caret').click(function() { if($('.dropdown-services').is(":visible")) { $('.dropdown-services').slideup(300); } else { $('.dropdown-services').slidedown(300); } }); });
here navbar's code:
<div class="navbar"> <div class="box first"> <a href="/pages/home" class="link-disabled">hr4d</a> </div> <div class="box second"> <span class="tagline">define, develop, deliver, , differentiate</span> <br> <a class="link" href="/pages/home"> home </a> <a class="left link" id="services" href="/pages/services"> services </a> <div class="caret" id="caret"></div> <a class="left link" href="/pages/contact"> contact </a> <a class="left link" href="/pages/about"> </a> </div> </div>
not sure how fix problem. appreciated.
the problem largely caused turbolinks. 1 way i've worked around it, disable turbolink entirely or disable specific portions of code. disable globally, in app/assets/javascripts/application.js
remove line requires turbolinks.
Comments
Post a Comment