Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6721671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:21:25+00:00 2026-05-26T09:21:25+00:00

Sorry if this question sounds stupid, but I only know HTML/CSS and so I’m

  • 0

Sorry if this question sounds stupid, but I only know HTML/CSS and so I’m trying to figure things out as best I can.

I’m using jQuery to create a slide down affect when someone scrolls down on my page.

Example: http://buckinvestor.com/test/jquerytest.html

I figured it all out, including a “Close” button, but now I have to figure out how to set a cookie so users don’t keep getting the slide down on every page. I’d like to set the cookie for 10 days.

I read that I should be using:

http://plugins.jquery.com/project/cookie

and then to write a cookie do $.cookie("test", 1);
to access the set cookie do $.cookie("test");

But I don’t know where I’m supposed to put this code. Can someone please show me the exact code I need to put in place and where? And also, is there anything bad I should be aware of when setting a cookie like this?

Thank you StackOverflow Gods!

You have been a life saver.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:21:26+00:00Added an answer on May 26, 2026 at 9:21 am

    I imagine you’d want to do something like this:

    $(function() {
        var bar = $('#headerSlideContainer'),
            top = bar.css('top');
        if (!($.cookie("test"))) {
            $(window).bind("scroll", function() {
                if($(this).scrollTop() > 50) {
                    bar.stop().animate({'top' : '0px'}, 500);
                } else {
                    bar.stop().animate({'top' : top}, 500);
                }
            });
            $.cookie("test", 1);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this sounds like a really stupid question, but I need to make
I am sorry, if this question sounds stupid, but I have searched a lot
sorry for this question, but i dont know where to search for it, or
Sorry if this sounds like a really silly question. But I Googled the web
I know this question might sound quite stupid, but I've tried my best and
Sorry if this sounds like a newbie question, but the other day a Java
Sorry if this is a stupid question, but I have come across a problem
sorry if my question sounds very stupid, Im trying to learn asp.net . Anyway,
I'm sorry if this sounds like a stupid question, because it seems to be
I am not expert for .htaccess, therefore sorry if this question sounds stupid. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.