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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:03:26+00:00 2026-05-27T14:03:26+00:00

I have a page that will popup a fancybox using $(‘#showpopup’).fancybox().trigger(‘click’); This may be

  • 0

I have a page that will popup a fancybox using

$('#showpopup').fancybox().trigger('click');

This may be triggered to popup several times (not at once) as the user navigates the page.

On the popup there is a button which triggers an action when clicked

$('#mybutton').click(function(){

   $('#otherbutton').trigger('click');

});

When the fancybox popup shows first time I click #mybutton and #otherbutton will trigger once.

When the fancybox popup shows the second time I click #mybutton and #otherbutton will trigger twice.

When the fancybox popup shows the third time I click #mybutton and #otherbutton will trigger three times…and so on.

How can I stop this issue with fancybox so that otherbutton will only trigger once?

  • 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-27T14:03:27+00:00Added an answer on May 27, 2026 at 2:03 pm

    It sounds like you are binding the click event handler for the #mybutton element within a Fancybox event (onStart, onComplete, etc.).

    Two ways to fix this are:

    1. On the onClosed or onCleanup events you can unbind the click event handler for the #mybutton element: $('#mybutton').unbind('click');. This way they will not build up and fire multiple times on a single click.
    2. You can move $('#mybutton').click(function(){$('#otherbutton').trigger('click');}); outside any Fancybox event handler (if the button is not present in the DOM until the Fancybox is displayed then you can use .delegate() to bind the click event handler to this button). $(document).delegate('#mybutton', 'click', function () {...}) (note that you can change document to any root element that is present in the DOM at the time of binding).

    Docs:

    • .unbind(): http://api.jquery.com/unbind
    • .delegate: http://api.jquery.com/delegate

    I also noticed that you linked to the old version of Fancybox, if you are using 1.x then I suggest changing to 2.0: http://fancyapps.com/fancybox/

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

Sidebar

Related Questions

I am loading content into a page with ajax that will have live click
I have a login popup that will pop up on every page of my
I have a page that will basically be used to concatenate a bunch of
I have a page that will have a full size product image and 4
I'm have a page that will be used (and hence styled) only for printing.
I have a page a query that will set a table to 0 or
I have an asp.net page that calls a dll that will start a long
I have to do a asp.net web page that when load will say something
I have a script that will get images from page, but how do I
I'm creating a WP theme that will have two sections midway down the page.

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.