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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:52+00:00 2026-05-27T04:38:52+00:00

The question is: how can I make it so that every time openZonePupup() is

  • 0

The question is: how can I make it so that every time openZonePupup() is called, whatever is assigned to the .click function changes on every call because right now it only changes on the first call ofopenZonePupup()

Let me first try and explain what the program does through prose and examples. This is for an online course which is split up into units. once a unit is clicked on a box pops up asking the user if they want to do a lesson or an exercise and then the lesson and exercise button has a function attached, with specific variables related to that lesson or exercise, to it with the .click function.

The problem is that once one unit has been clicked upon and the specific variables in the function applied using the .click function, once this popup has been closed and the user clicks on another unit, it uses the same specific variables from the first time. Maybe looking at my code would help you better:

Popup HTML:

<div class="jqmWindow" id="dialog">
    <a id="popupHide" href="javascript:;" onclick="$('#dialog').jqmHide();" style=""></a>

    <div id="zoneName"></div>
        <div id="buttons">
            <a id="lessonButton" class="lessonButton">Lesson</a>
        <a id="exerciseButton" class="exerciseButton">Exercise</a>
    </div>
    </div>
</div>

The function called when the link to the unit is clicked on. It applies the name to the popup html and sets the link to the lesson and exercise according to the variables specified, then after it shows the popup:

function openZonePupup(name,juegoID,tipoID,lang,nivel) {
    $("#zoneName").html(name);

    $(".lessonButton").click(function () { 
    $('#dialog').jqmHide();
        abrirLeccion(juegoID,nivel);    
    });

    $(".exerciseButton").click(function () { 
        obreJoc(juegoID, tipoID, name);
        $('#dialog').jqmHide();
    });

    $('#dialog').jqmShow();
}

openZonePopup is called by the text for the unit, for example:

<a href="javascript:;" onclick="abrirZonePopUp('Past Simple - Past Continuous ',8,2,'EN',1);">02</a>
<a href="javascript:;" onclick="abrirZonePopUp('Conjunctions',22,8,'EN',1);">14</a>

I hope you understand, if not leave a comment and i’ll respond asap, thanks for any help that you can give!

  • 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-27T04:38:52+00:00Added an answer on May 27, 2026 at 4:38 am

    As a first step I would try unbinding the click handlers before binding them to the specific values passed by the function.

    function openZonePupup(name,juegoID,tipoID,lang,nivel) {
        $("#zoneName").html(name);
    
        $(".lessonButton").unbind("click").click(function () { 
            $('#dialog').jqmHide();
            abrirLeccion(juegoID,nivel);    
        });
    
        $(".exerciseButton").unbind("click").click(function () { 
            obreJoc(juegoID, tipoID, name);
            $('#dialog').jqmHide();
        });
    
        $('#dialog').jqmShow();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I make a loop that can take user input every time it
I want to make a progress bar that fills up every time a user
Quick question, how can I make this valid : if($this->datos->bathrooms == 1½){$select1 = JText::_(
Brief question What command can I use to make my DataSet refresh it's connection
I am starting this question to try and make a central point developers can
Question Can I build a image database/library that has an e-commerce style checkout system
I've been writing a program that can determine any and every data about an
Every time I create an object that has a collection property I go back
My question is, how I can make a cluster analysis from spatial - temporal
I finally got my application to seemingly post to https. However, every time 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.