Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- $(document).ready(function () {
- let header = $('.cf_bal-header');
- // Check for first timers
- if (!sessionStorage.returnVisitor) {
- // No flag, this is the first visit.
- // Set a flag so that next time we know they have been here before.
- sessionStorage.returnVisitor = 'true';
- // Handle Hero image click.
- $('.cf_news_link').click(function () {
- header.slideUp(600, function () {
- $('body').removeClass('cf_bal-locked');
- });
- });
- // Handle scrolling (this is our scroll jacker)
- $(window).on('scroll', function () {
- ($(header).slideUp(600, function () {
- $('body').removeClass('cf_bal-locked');
- }))
- });
- } else {
- // Not our first time, hide header.
- header.hide();
- $('body').removeClass('cf_bal-locked');
- }
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement