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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:43:54+00:00 2026-06-01T09:43:54+00:00

I have read over a dozen posts and answers … to no avail. What

  • 0

I have read over a dozen posts and answers … to no avail.

What is wrong with this simple code, what am I missing here.
None of tried callbacks works.

$("#project_info").fancybox({
        'onComplete': function() {
            console.log('log this');
            //$.cookie('fcookie', '1', {path: ' / '});
        }
    });
$("#project_info").fancybox().trigger("click");

and html

<a id="project_info" href="#project_display"></a>
<div style="display: none;">
    <div id="project_display" style="width:100px; height:100px; overflow:auto;">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    </div>
</div>

note: local wamp

edit: also tested on remote server – strip-down file to prevent any interactions – same result

  • 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-01T09:43:55+00:00Added an answer on June 1, 2026 at 9:43 am

    I am answering my own question, to post solution I finally used and tests performed.
    Maybe someone finds it useful.

    There is something in fancybox 1.3 that kills callbacks, when cookie is used in them.

    No time to test, what is it.

    Anyone knows? write below.

    Just a note: same happened, when I tried to set cookie via .trigger(“click”)
    Callbacks work fine with standard click.

    What I tried – unsuccessfully.

    //trial 1: does not work
    $("#project_info").fancybox({
        onComplete: function() {
        $.cookie('fcookie', '1', {path: ' / '});
        }
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 2: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        onComplete: function() {
        StoreCookie()
        }
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 3: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        onComplete: StoreCookie
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 3: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        //
    });
    $("#project_info").fancybox().trigger("click", StoreCookie());//trial 1: does not work
    $("#project_info").fancybox({
        onComplete: function() {
        $.cookie('fcookie', '1', {path: ' / '});
        }
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 2: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        onComplete: function() {
        StoreCookie()
        }
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 3: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        onComplete: StoreCookie
    });
    $("#project_info").fancybox().trigger("click");
    
    //trial 3: does not work
    function StoreCookie() { 
        $.cookie('fcookie', '1', {path: ' / '});
    } 
    $("#project_info").fancybox({
        //
    });
    $("#project_info").fancybox().trigger("click", StoreCookie());
    

    this I settled for

    I do not like it very much thou
    since cookie is stored somewhat outside of fancybox firing up

    if (!$.cookie('fcookie')) {
        $("#project_info").fancybox({
        onComplete: function() {
            //
        }
        });
        $("#project_info").fancybox().trigger("click");
    }
    $.cookie('fcookie', '1', {path: ' / '});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read some of the questions and answers here, but it none match
I have read over this which sort of gives an explanation of when you'd
I have read through multiple posts here until my head was ready to explode
Alright...I've given the site a fair search and have read over many posts about
I have quickly read over the Microsoft Lambda Expression documentation. This kind of example
I have read through this post over and over, and yet it doesn't make
I have read the documentation and searched all over but I can't find how
I have read many answers to questions about dynamically resizing NSWindows and nothing has
I have read various posts in stackoverflow and I am trying to figure out
I have read a lot of topic here and people tend to store IP

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.