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 6583353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:23:51+00:00 2026-05-25T16:23:51+00:00

I was wondering how I would be able to hide a post with jquery.

  • 0

I was wondering how I would be able to hide a post with jquery. I was able to get the posts to hide using this code from the jquery api

 <head>
   <style>
   span { background:#def3ca; padding:3px; float:left; }
   </style>
   <script src="http://code.jquery.com/jquery-latest.js"></script>
 </head>
 <body>
   <button id="hidr">Hide</button>
   <button id="showr">Show</button>
   <div>

     <span>Once</span> <span>upon</span> <span>a</span> 
     <span>time</span> <span>there</span> <span>were</span> 
     <span>three</span> <span>programmers...</span>

   </div>
 <script>
     $("#hidr").click(function () {
     $("span:last-child").hide("fast", function () {
     // use callee so don't have to name the function
     $(this).prev().hide("fast", arguments.callee); 
    });
  });
   $("#showr").click(function () {
     $("span").show(2000);
   });

 </script>

 </body>

but the problem is that this doesn’t save the hide so when I refresh the browser the post is shown again. I want to be able to have the user who posted the post press hide and have the post hide for him but also hide for everyone else on the site. I’m not sure how to make this work though so I could use some help.

  • 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-25T16:23:52+00:00Added an answer on May 25, 2026 at 4:23 pm

    If you want the behaviour

    > but also hide for everyone else on the site

    you will have to persist the state of the sections in a database. Then you can build a helper that returns you if a section has to be displayed or not based on the section’s id…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering how I would be able to get an SSIS package from
I was wondering if anyone would be able to help me fix this script...It
I was wondering if someone would be able to help me out with this
I am wondering how would I do this with like jQuery ajax. Right now
I was wondering if someone would be able to help me write a CQL
I was wondering, whether knockd http://www.zeroflux.org/cgi-bin/cvstrac.cgi/knock/wiki would be a good was to be able
i was wondering what would be the best way to code a browser plugin
I was just wondering which would be cheaper, using a try catch block for
I am wondering how would I be able to run a SQLite order by
I was wondering how would I be able to show SQL errors generated during

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.