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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:24:13+00:00 2026-05-31T01:24:13+00:00

I’m trying to create a clean jquery pop-up with different functionalities. I dont want

  • 0

I’m trying to create a clean jquery pop-up with different functionalities. I dont want to use a plug-in (and I want to learn lol). Here is what I want.

  1. center it in the screen (that’s done and working)
  2. close that pop-up whenever the user click outside of it. (We need to be able to click INSIDE the pop-up thought)
  3. I want the html content of the pop-up to change depending on the link you clicked. ( ex. I want a list in my pop-up for link 1, and a form for link 2) — (No idea at all how to do that)

Now here’s what I have: http://jsfiddle.net/RYwsy/2/

I did some research, but there are SO many different techniques out there, that im completely lost. And I want the cleanest/fastest way possible yo do that with jQuery.

Im still searching and trying things, but I would like some help too.

Thanks!

  • 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-31T01:24:15+00:00Added an answer on May 31, 2026 at 1:24 am

    Wow, this was more tricky than expected… Long story short, I edited your fiddle: Here and it works now.

    Edit: new fiddle that uses the event propagation more neatly: http://jsfiddle.net/RYwsy/23/

    Point 3 was pretty straightforward. If you want the content to come from somewhere on the page, find it based on some property of the link clicked, or the context it’s in (like looking at its siblings or something). In my example i just added an id attribute to the link, and used that to identify a hidden div that contains the content and insert it in the popup.

    Point 2 was more tricky. At first I just attached a click handler to everything except the popup, and hid the popup in there. This didn’t work, because the click events from the popup propagated up through the dom, and eventually reached some element the hid the popup. I then added a check on whether we are clicking the popup, and if we are, stop the propagation in there.

    Whether this is the cleanest solution is probably highly debatable, but it is fairly clean and if nothing else is a good example of why you need to understand event propagation in javascript 🙂

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

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.