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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:15:07+00:00 2026-06-16T00:15:07+00:00

Dear community, I ask your help, did here’s a crutch , it is strange

  • 0

Dear community, I ask your help, did here’s a crutch, it is strange that a modal window with the content does not appear, probably out of the scope of a frame, locally it works. The question is, how to make so that my window is not already appear if a user has a cook. I can not figure out how to add the if(){}. Seems to do everything right. And yet, after adding the conditions, in the firebag the entry error: Uncaught ReferenceError: getCookieValue is not defined

But this design does not work (location in the body):

<script type="text/javascript">
    $(document).ready(function() {
        var getCookieValue = $.cookie("visit");
        if (getCookieValue == true) {
            $("a.gallery2").fancybox(
                {                       
                    "padding" : 20, 
                    "imageScale" : false, 
                    "zoomOpacity" : false,  
                    "zoomSpeedIn" : 1000,   
                    "zoomSpeedOut" : 1000,  
                    "zoomSpeedChange" : 1000,
                    "frameWidth" : 700,
                    "frameHeight" : 600, 
                    "overlayShow" : true,
                    "overlayOpacity" : 0.8, 
                    "hideOnContentClick" :false,        
                    "centerOnScroll" : false                
            }).click();
        }
    });

</script>
  • 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-16T00:15:07+00:00Added an answer on June 16, 2026 at 12:15 am

    It is not clear to me whether you want to show fancybox only when the cookie is true or not. Assuming that fancybox should be shown only if the cookie value is true, then try this

    <script type="text/javascript">
    $(document).ready(function() {
      // create cookie "visit"
      var getCookieValue = $.cookie("visit");
      // check if cookie value = true
      if (getCookieValue == "true") {
           $("a.gallery2").trigger("click");
      }
      $.cookie("visit", "true", { expires: 7 }); // set the number of days for cookie
      $("a.gallery2").fancybox({                       
         // API options here
      }); // bind fancybox
    });
    </script>
    

    In this case, the fancybox won’t be shown during the first visit but always after the second while the cookie is valid.

    On the other hand, if fancybox should be shown during the first visit only, then try :

    <script type="text/javascript">
    $(document).ready(function() {
      // create cookie "visit"
      var getCookieValue = $.cookie("visit");
      // check if cookie value = true
      if (getCookieValue == "true") {
          return false
      } else {
          $("a.gallery2").trigger("click");
      }
      $.cookie("visit:, "true", { expires: 7 }); // set the number of days for cookie
      $("a.gallery2").fancybox({                       
         // API options here
      }); // bind fancybox
    });
    </script>
    

    In both examples, it’s assumed that you have this html somewhere in your code:

    <a class="gallery2" href="path/target"></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear friends, I need your help. I need to send .bmp file to another
Dear stackoverflow community, I have a simple menu that have to be dynamics. With
Dear community members, I am actually a bit new to CSS, however I know
Dear community members, I have a small problem, which involves a text input field
Dear members of the Stackoverflow community, We are developing a web application using the
Dear All, please help me since I'm newbie in SQL Server. I have a
Dear Masters! Is it possible to ensure, that only characters with codes between 0
dear i am confused the use of content provider in android applications.i go through
Dear LINQ or linq2sql experts, can you help me to solve this case? I
Dear community members, I would like to position the text inside test in 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.