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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:01:20+00:00 2026-06-18T02:01:20+00:00

I needed to create bubble popups on click, but I ran into trouble with

  • 0

I needed to create bubble popups on click, but I ran into trouble with being able to open infinite bubbles. I need only one popup opened at a time, so I added:

if ($(‘.icon’).HasBubblePopup()) { alert(‘Please close current popup before opening another.’); return false; }

My issue is that this alert appears after opening and closing one or two popups, even though it appears no popups are open.

My HTML:

<img id="icon01" class="icon" src="images/icon01.png">
<img id="icon02" class="icon" src="images/icon02.png">
<img id="icon03" class="icon" src="images/icon03.png">

My jQuery:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-bubble-popup-v3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var icon01 = 
        '<div class="popup">' +
        '<h2>First Title</h2>' +
        '<p>Sweet jelly beans macaroon cheesecake cookie caramels chocolate cake gummi bears muffin.</p>' +
        '</div>';
    var icon02 = 
        '<div class="popup">' +
        '<h2>Second Title</h2>' +
        '<p>Bonbon lollipop soufflé halvah chupa chups jelly beans.</p>' +
        '</div>';
    var icon03 = 
        '<div class="popup">' +
        '<h2>Third Title</h2>' +
        '<p>Pastry bear claw wafer candy candy sweet roll chocolate bar chocolate cake.</p>' +
        '</div>';

    $('.icon').click(function() {
        var iconID = this.id;

        if ($('.icon').HasBubblePopup()) {
            alert('Please close current popup before opening another.');
            return false;
        }

        $('.icon').CreateBubblePopup();
        var iconClick = $(this);
        var bubblePopupID = iconClick.GetBubblePopupID();
        iconClick.ShowBubblePopup({
            position : 'top',
            align    : 'center',
            innerHtml: eval(iconID),
            innerHtmlStyle: {
                                color:'#000',
                                'text-align':'center'
                            },
            themeName:  'grey',
            themePath:  'images/jquerybubblepopup-themes'
        }, false);

        iconClick.FreezeBubblePopup();
        $('#' + bubblePopupID).click(function() {
            $(iconClick).RemoveBubblePopup();
        });
    });
});
</script>

Page I’m working on: http://www.dynasoft2000.com/fire

Edit: I decided instead of using an alert, closing the current popup and opening the new one would be a better solution. Here’s my final code:

    $('.icon').click(function() {
        var iconID = this.id;

        if ($('.icon').map(function() {
            if ($(this).HasBubblePopup())
                return true;
        })[0]) {
            $('.icon').RemoveBubblePopup();
        }

        var iconClick = $(this);
        iconClick.CreateBubblePopup();
        var bubblePopupID = iconClick.GetBubblePopupID();
        iconClick.ShowBubblePopup({
            position : 'top',
            align    : 'center',
            innerHtml: eval(iconID),
            innerHtmlStyle: {
                                color:'#000',
                                'text-align':'center'
                            },
            themeName:  'grey',
            themePath:  'images/jquerybubblepopup-themes'
        }, false);

        iconClick.FreezeBubblePopup();
        $('#' + bubblePopupID).click(function() {
            $(iconClick).RemoveBubblePopup();
        });
    });
  • 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-06-18T02:01:21+00:00Added an answer on June 18, 2026 at 2:01 am

    you should relay to current element when creating buble, also HasBublePipup works stange, I wrap it with map;
    change code to this:

    $('.icon').click(function() {
            var iconID = this.id;
    
            if ($('.icon').map(
               function() {
                if ($(this).HasBubblePopup()) return true;
                }
               )[0]); { //<-HERE
                alert('Please close current popup before opening another.');
                return false;
            }
            var iconClick = $(this);
            iconClick.CreateBubblePopup(); // <-- AND HERE
            var bubblePopupID = iconClick.GetBubblePopupID();
            iconClick.ShowBubblePopup({
                position : 'top',
                align    : 'center',
                innerHtml: eval(iconID),
                innerHtmlStyle: {
                                    color:'#000',
                                    'text-align':'center'
                                },
                themeName:  'grey',
                themePath:  'images/jquerybubblepopup-themes'
            }, false);
            iconClick.FreezeBubblePopup();
            $('#' + bubblePopupID).click(function() {
                $(iconClick).RemoveBubblePopup();
            });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently needed to create speech bubbles. To create the little triangular tip at
I'm reaaallly new at JSON, but here's what I got. I needed to create
I needed to create a drop down menu which would open up instead of
Learning Ruby. Needed to create a hash of arrays. This works... but I don't
I needed to create an application using Struts2 as MVC,Hibernate for data access and
What CSS is needed to create such an HTML layout: +--[li]---------------------------------------------+ |+--[div]-------------------------------------++---+| || A
So I came to a point where I needed to create a custom query
which framework helps in reducing the number of lines of code needed to create
In unit testing, the setup method is used to create the objects needed for
I needed to create a input mask for a jQuery datepicker in my Rails

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.