I have two pages here: index and results. On the results.html, I have some divs with CSS property set as display: none. I would like to navigate from index (nav menu) and open the results pages while displaying the div that was hidden. The jQuery works fine on the results.html, but I don't know how can I trigger this function coming from the index.
Index:
<ul>
<li><a id="menu-2016" href="results.html#2016">2016</a></li>
<li><a id="menu-2015" href="results.html#2015">2015</a></li>
</ul>
Results:
<section id="2016">Content</section>
<section id="2015">Content</section>
CSS:
#section-2015, #section-2016 {
display: none;
}
jQuery:
$(document).ready(function () {
$("#menu-2016").click(function () {
$("#section-2016").slideDown();
$("#section-2015").slideUp();
});
$("#menu-2015").click(function () {
$("#section-2015").slideDown();
$("#section-2014").slideUp();
});
});