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

  • SEARCH
  • Home
  • 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 514357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:30:58+00:00 2026-05-13T07:30:58+00:00

I am trying to reproduce the lock function on posts on facebook with jquery

  • 0

I am trying to reproduce the lock function on posts on facebook with jquery and php/mysql.

Below is an image showing the different actions it does when clicked on.

I think you would do somehing like on hover, show a hidden div with a tooltip, on hover off remove it. On click event show another hidden div but somehow has to change the button’s colors as well. When the menu div is clicked open it has a menu and if any of these are clicked it needs to send the result to backend script with ajax. After clicking an option or clicking outside of the divs it will hide all the divs, maybe it is just a click anywhere closes it so maybe a toggle can be used?

Can anyone clarify I am going in the right direction. I havent used jquery very much or javascript. Any examples of something like this or help would be greatly appreciated.

fb http://img2.pict.com/ed/9a/3a/2341412/0/screenshot2b166.png

  • 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-13T07:30:59+00:00Added an answer on May 13, 2026 at 7:30 am

    You don’t need JavaScript for the hover. Make an element that serves as your tooltip and position it above your dropdown button. Then make a parent <div> for both. Your HTML should look something like this:

    <div id="container">
        <div id="button">...</div>
        <div id="tooltip">...</div>
    </div>
    

    Once you’ve done that, you can use CSS to position the tooltip and show it when necessary.

    #container {
        /* All child elements should be positioned relative to this one. */
        position: relative;
    }
    
    #container #tooltip {
        /* Hide by default. */
        display: none;
        /* Place the tooltip 2px above the button. */
        position: absolute;
        bottom: 2px;
        right: 0px;
    }
    
    #container #button:hover + #tooltip {
        /* Show it when someone's hovering over the button. */
        display: block;
    }
    

    To show the drop-down box, you probably will need JavaScript. Add another element to the container:

    <div id="container">
        <div id="button">...</div>
        <div id="tooltip">...</div>
        <ul id="selection">
            <li>Something</li>
            <li>Something Else</li>
            <li>A Third Thing</li>
        </ul>
    </div>
    

    Position it as you like using position: absolute and hide it using display: none. Then show it when we click on the button:

    $('#button').click(function() {
        $('#selection').show();
    });
    

    You can then make your sub-items do whatever they like, as long as they also hide #selection.

    $('#selection li').click(function() {
        // do something
        $('#selection').hide();
    });
    

    Finally, you want to change the background and text colours upon hover. That’s easy enough:

    #selection li {
        background-color: #ccc;
        color: black;
    }
    
    #selection li:hover {
        background-color: black;
        color: white;
    }
    

    This won’t work perfectly in IE 6 or (I believe) 7 – you’ll need to investigate alternative solutions for that. Either use JavaScript or check out IE7.js and IE8.js.

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

Sidebar

Related Questions

I'm trying to reproduce this html using jquery on a click event. <div class=comments_action_207>
Trying to make a MySQL-based application support MS SQL, I ran into the following
I'm trying to reproduce an accordion effect when scrolling up and down shown on
I am trying to reproduce the account chooser widget that the GMail app has
I'm trying to reproduce the exact behavior of Erlang phash in another language (Ruby
I'm trying to reproduce the Jekyll plugin example from https://github.com/mojombo/jekyll/wiki/Plugins to render the *render_time*
I'm trying to reproduce Fractals without a computer but with a computer instead of
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to get my css / C# functions to look like this: body {
Trying to find some simple SQL Server PIVOT examples. Most of the examples that

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.