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

  • Home
  • SEARCH
  • 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 9178051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:27:45+00:00 2026-06-17T17:27:45+00:00

I have a problem. I have copied exactly the same code as I have

  • 0

I have a problem. I have copied exactly the same code as I have on my page and it works fine on jsfiddle here. This code doesn’t work when I paste it to html/css/js. Is there any reason that happens? what is wrong with the code?
I’m sure it’s something simple, but I just can’t figure it out. Thank you very much for your help in advance.
BTW: here is a source code if you need one. Need to wait 4 seconds as it will slide down. The X button should hide the wholde div, but it doesn’t. that’s the issue.

the code is here:

     <div id="wrapper">
        <div id="cookies">
            <p>Leed City Wifi uses cookies. By continuing to browse the site you are agreeing to use our cookies: </p>
            <a href="terms-cookies.html">Find out more</a>
            <a href="#" id="close" > <img src="http://content.captive-portal.com/cookies/_images/close.png"/></a>
        </div>        
</div> 

and jquery here:

$(document).ready(function(){
$('#wrapper').hide();
function delay() {
    $('#wrapper').slideDown(500);
}
setTimeout(delay, 500);
});

$(document).ready(function(){
$('#cookies').hide();
function delay() {
    $('#cookies').slideDown(200);
}
setTimeout(delay, 4000);
});


$("#close").click(function() {
 $("#cookies").slideUp(function() {
     window.location.href = "#";
     });
 });

jsfiddle here.
Thank you for your time in advance

  • 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-17T17:27:47+00:00Added an answer on June 17, 2026 at 5:27 pm

    Change your delay.js file to this…

    $(document).ready(function(){
        $('#wrapper').hide();
        $('#cookies').hide();
    
        setTimeout(function() {
            $('#wrapper').slideDown(500);
        }, 500);
    
        setTimeout(function() {
            $('#cookies').slideDown(200);
        }, 4000);
    
        $("#close").click(function() {
            $("#cookies").slideUp(function() {
                window.location.href = "#";
            });
        });
    });
    

    I’ve put it all in one document.ready block, rather than multiple ones, put the functions directly into the timeout calls, and fixed a syntax error with the close click handler (you were missing some closing parenthesis).

    Also, the close click handler needed to be assigned during document.ready, which it previously wasn’t. That’s why it worked on jsFiddle, because that used onLoad by default.

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

Sidebar

Related Questions

I have the following code, copied exactly from a exercise from a PHP book.
I have problem with my query on C, I’m using the oci8 driver. This
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have copied the following code from Wrox Professional ASP.NET 4.0 MVC 4 book,
I have a .net 3.5 application written in c# and it works fine except
I have a problem using opengl on android to draw a simple rectangle. This
I have two pages - a simple HTML code example page from a jQuery
I'm not exactly sure how to properly debug this but have tried a few
I have one problem to work with NSMutableData . I defined one NSMutableData *receivedData
I have been trying to find an answer and get this to work for

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.