'How to run the animation only once per page?

How can I change the following code to run only once per session, and once per page. The div#edgtf-manon-loading-title appears on every page. So, on the second time the same user/session goes to the same page they went before, the animation would NOT load anymore. Thanks!

function edgtfLoadingTitle() {
    var loadingTitle = $('#edgtf-manon-loading-title');

    if (loadingTitle.length) {

        var fallback = edgtf.body.hasClass('edgtf-ms-explorer') ? true : false;
        var done = function() {
            edgtfEnableScroll();
            edgtf.body.addClass('edgtf-loading-title-done');
            $(document).trigger('edgtfTitleDone');
        };

        var toTop = function() {
            loadingTitle
                .addClass('edgtf-to-top')
                .one(edgtf.transitionEnd, done);

        };

        edgtfDisableScroll();
        loadingTitle.addClass('edgtf-load');
        if(fallback) {
            toTop();
        }

        loadingTitle.one(edgtf.animationEnd, toTop);
    }
}

Is there a way I can add something like this code below to the original? And where exactly?

var yetVisited = localStorage['visited'];
if (!yetVisited) {
   //something here
};


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source