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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:11:37+00:00 2026-05-27T19:11:37+00:00

I want to implement on my site show-hidden div block as on stackoverflow.com –

  • 0

I want to implement on my site show-hidden div block as on stackoverflow.com – at a time when the user wants to hide it himself putted on button “X”. May already have a ready-made solution? I am not verse in Javascript and would be very grateful for the help!

Picture:

  • 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-27T19:11:38+00:00Added an answer on May 27, 2026 at 7:11 pm

    This is simple working example without using any external library. You can improve it with your animation/design. Also these functions for cookies can be very simplier but you can use it in future to set not only boolean value.
    UPDATE: I added functon for show your popup again (for debug mostly).

    <html>
    <head>
    <script type="text/javascript">
    function setCookie (name, value, expires, path, domain, secure) {
        document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
    }
    function getCookie (name) {
        var cookie = " " + document.cookie;
        var search = " " + name + "=";
        var setStr = null;
        var offset = 0;
        var end = 0;
        if (cookie.length > 0) {
            offset = cookie.indexOf(search);
            if (offset != -1) {
                offset += search.length;
                end = cookie.indexOf(";", offset);
                if (end == -1) {
                    end = cookie.length;
                }
                setStr = unescape(cookie.substring(offset, end));
            }
        }
        if (setStr == 'false') {
            setStr = false;
        } 
        if (setStr == 'true') {
            setStr = true;
        }
        if (setStr == 'null') {
            setStr = null;
        }
        return(setStr);
    }
    function hidePopup() {
        setCookie('popup_state', false); 
        document.getElementById('popup').style.display = 'none';
    }
    function showPopup() {
        setCookie('popup_state', null);
        document.getElementById('popup').style.display = 'block';
    }
    function checkPopup() {
        if (getCookie('popup_state') == null) { // if popup was not closed
            document.getElementById('popup').style.display = 'block';
        }   
    }
    
    </script>
    </head>
    <body onload="checkPopup();">
         <div id="popup" style="display:none">Hello! Welcome to my site. If you want to hide this message then click <a href="#" onclick="hidePopup(); return false;">[x]</a></div>
         <div>Some static text here.</div>
         <div>Bring me <a href="#" onclick="showPopup(); return false;">back</a> my popup!</div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement an automated backup system for my site's SQL Server 2005
I want to implement forms authentication on an ASP.NET website, the site should seek
I tried to implement paypal pro for my site. Which will let user enter
I want to implement a chat site with following features: Direct one-on-one chat with
I want to implement heatmap for our site based on our own site logs,
I want to implement multi language in my site using zend framework. I need
I want to implement Facebook connect login for my Django site and I've checked
Essentially, I want to implement a jQuery feature on a site that I'm building,
I want to implement a web site from scratch using Semantic Web as much
I want to implement semantic search into my rails site. I currently have a

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.