Recently, I incorporated SlideUp and SlideDown jquery animations into my website. You can check it out by visiting (click the >>>). However, I noticed a small issue where when users navigate to a new page, they have to re-SlideUp the element that was slid up on the previous page. Is there a way to detect if the element was visible before navigation?
$(function(){
if (sessionStorage.getItem("tabvisible")) {
$(".jumbotron").slideDown(); // displaying header
} else {
$("jumbotron").slideUp(); // hiding header
}
$('.information').hide().fadeIn('slow');
$("#expandiconup").click(function(){
$(".jumbotron").slideUp();
sessionStorage.setItem("tabvisible", false);
});
$("#expandicondown").click(function(){
$(".jumbotron").slideDown();
sessionStorage.setItem("tabvisible", true);
});
});