What could be causing the issue with my CodePen not displaying properly on my website?

First Attempt:

After implementing My code pen on a page, I encountered a blank screen. I then created a separate JS sheet for my sober child theme and tested it with an alert which worked fine. However, when I tried to implement the desired JS code, nothing happened.

Second Attempt:

For my second try, I included all JS and HTML elements as RAW from wp-bakery, but still, nothing happened.

What steps should I take to ensure that this code functions properly?

View codepen here


$('.window').draggable();
$('.icon').draggable();

$('.cancel, .close').on('click', function(e){
   e.preventDefault();
  $('.window').hide();
});

$('.ok').on('click', function(e){
   e.preventDefault();
  $('.overlay').toggleClass('on');
  $('.power-button').fadeIn();
});

$('.start-btn').on('click', function(e){
   e.preventDefault();
  $(this).toggleClass('active');
  $('.start-menu').toggleClass('open');
});


$('.windows-update').on('click', function(){
  $('.overlay').addClass('on');
  $('.start-menu').removeClass('open');
  $('.start-btn').removeClass('active');
  $('.window').hide();
  $('.power-button').hide();
  setTimeout(function(){
    $('.desktop').addClass('windowsXP');
    $('.overlay').removeClass('on');
    }, 3000);
});


$('.turn-on-computer').on('click', function(){
  $('.power-button').addClass('on');
  $('.window').hide();
  $('.start-menu').removeClass('open');
  $('.start-btn').removeClass('active');
  setTimeout(function(){
    $('.power-button').removeClass('on');
    $('.power-button').fadeOut();
    }, 2000);
  setTimeout(function(){
    $('.overlay').removeClass('on');
    }, 3000);
});

Answer №1

Have you taken the necessary steps to include jQuery and jQuery UI in your website?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Developing a new file in mongoose using the { strict: false } configuration option

I have a task of storing various documents into MongoDB, all with the same top-level structure but different details within. The payload for each document looks like this: { "types": "a", //the type can be "a", "b" or "c" "details" : { ... // t ...

Customize your markers on Google Maps

I have integrated Markerclusterer with Google Maps in a similar way to the example provided. Here is my code snippet: var map = new google.maps.Map(document.getElementById("map"), options); var markers = []; for (var i = 0; i < 100; i++) { var latLn ...

When the mouse leaves the area, I would like the iframe within the div to be refreshed

When you hover over the button on the right, a slide panel appears with an iframe. Each time this page loads, it has a different background. I want a new background to load every time there is a new hover, requiring a refresh of the div. How can I achieve ...

What is preventing me from accessing React state within Tracker.Autorun?

I'm feeling lost on this one. I have implemented a Tracker.autorun function to monitor when my Mongo subscription is ready for querying (following the advice given in this previous Meteor subscribe callback). It seems to be working fine as it triggers ...

Determine if an Android application has been installed using JavaScript or jQuery

I'm working on an Android app that is also accessible via a web browser. I want to add a banner prompting users to install the Android application if they haven't already. How can I use JavaScript or jQuery to detect if the user has the app insta ...

What is the best way to check for date equality in Node.js?

I am dealing with this code condition: stopped_at: { $lte: new Date(Date.now() - 86400 * 1000) } The above code successfully retrieves dates that are less than or equal to 24 hours ago. However, I am wondering if there is a simpler solution a ...

I am eager to incorporate my own unique 'add to cart' button

Currently, I'm utilizing the Motta theme for my WooCommerce store. However, I find the add to cart button to be too large for my liking. I am hoping to simplify it to resemble a plus button. Any assistance in achieving this would be greatly appreciate ...

When querying parameters within a URL, you may encounter JavaScript (Node) errors

My current setup involves using Firebase Cloud Functions, but I have run into an issue. Whenever a parameter with a # symbol is received, it does not get recognized. For instance: http://example.net?id=123#456. When I check the logged id, only 123 is disp ...

Using PHP to extract information from a JSON file

After researching various articles and tutorials, I've managed to piece together the code below. However, as a beginner in PHP, JSON, and Javascript, I am seeking guidance. The task at hand is to update a div with the ID "playerName" every 10 seconds ...

Implementing week numbers display in Twitter Bootstrap's date picker

I am currently utilizing the Twitter Bootstrap datepicker plugin which can be found at the following link: My goal is to display week numbers similar to the example shown here: http://jsbin.com/omaqe/1/edit Instead of modifying the jQuery plugin, I would ...

Django application encounters a 404 error while trying to access the CSS file within the media

Within my Django application, I have configured the following settings: settings.py ------------ MEDIA_ROOT = '/home/me/dev/python/django/myproject/myapp/media/' MEDIA_URL = '/site_media/' urls.py -------- ... url(r'^myapp/' ...

Utilizing AngularJS with Restheart API to streamline MongoDB integration and efficiently parse JSON data outputs

Utilizing RestHeart to expose CRUD functionality from MongoBD. Attempting to call the Rest API from AngularJS and retrieve the JSON output like the one displayed below. My focus is specifically on extracting the name, age, & city fields that are stored in ...

Numerous categories housed within various div containers

I am working with an HTML code that contains 6 different div elements: <div class="hisclass1 hisclass2 myclass hisclass3"> <div class="herclass1 herclass2"> <!-- 2nd div --> </div> </di ...

The layout option is not specified within the ejs-mate package

error boilerplate I am baffled as to why the layout is not being defined. I have installed ejs-mate and ejs, yet it still gives this error. <% layout('layouts/boilerplate') %> <h1>All campgrounds </h1> <div> <a ...

Error occurred within node while attempting to create a directory using mkdirsync

I wrote some code. try{ var Storage = multer.diskStorage({ destination: function (req, file, callback) { fs.mkdirSync('/home/data/' + file.originalname, { recursive: true }, (error) => { ...

The jsPDF tool captures only the visible frame in a screenshot instead of printing the entire content on the screen

Recently, I integrated the jsPDF npm module into my Angular application to convert HTML to PDF. However, I encountered an issue where printing a website page to PDF only captures a screenshot of the visible area in Firefox and Chrome, as well as in Interne ...

What is the best way to vertically center align a div containing dynamic multiple lines of text?

Here is the CSS I'm utilizing: .flip-container { -webkit-perspective: 1000; -moz-perspective: 1000; perspective: 1000; } .flip-container:hover .flipper, .flip-container.hover .flipper { -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180 ...

Inquiry into the use of Jquery.ajax()

Hey there, I'm curious about using Jquery Ajax to retrieve a numeric value from a website. Any suggestions on where I should begin? Any advice would be greatly appreciated. Thanks in advance! Best regards, SWIFT ...

Calculating the number of rows in a dynamic jQuery table

I have a table structured like this: <div class="row"> <input type="button" id="btnAddGatePass" value="Add Gate Pass Requester" /> <div class="table-responsive"> <table id="gatePass" class="table table-striped table-ho ...

In mongoose and nodejs, there is no method called .find()

I am encountering an issue while attempting to locate by id and receiving the error bankApp.find is not a function. Below is my schema: import {model, Schema} from "mongoose"; const StatusResponse = new Schema({ uniqueKey: {type: String, trim: true, ...