The functionality to hide one div and display another in its place is disabled for popups and is not currently working as

For easy access, feel free to download my project files here. (Size: 2mb)

In my webpage, there is a popup containing two images and a heading inside a div. I want to implement a functionality where upon hovering over the div, it will hide and show another div with larger images and additional text. This feature works perfectly on the main webpage but not in the popup.

Here is a snippet of my HTML code:

<div class="thumb-list" id="popup-thumb-list">
   <div class="actor">
      <div class="small-thumb-holder">
         <a href="" class="actor_thumb"><img src="images/actor-01.jpg" width="65" height="50" /></a>
         <h3>Lucas Allen</h3> as FIRST MATE KARL-CAPTAIN CARRIBEAN
      </div>
      <div class="big-thumb-holder" id="big-thumb-holder">
         <a href="" class="big-thumb"><img src="images/029 Derek_Jeremiah_Reid-ID29597.jpg" width="150" /></a>
         <p>Derek Jeremiah Reid as Home Buyer<br>Click to see profile.</p>
      </div>
   </div>
   <div class="actor">
      <div class="small-thumb-holder">
         <a href="" class="actor_thumb"><img src="images/actor-02.jpg" width="65" height="50" /></a>
         <h3>Lucas Allen</h3> as FIRST MATE KARL-CAPTAIN CARRIBEAN
      </div>
      <div class="big-thumb-holder" id="big-thumb-holder">
         <a href="" class="big-thumb"><img src="images/030Rachel_O_meara-ID15405.jpg" width="150" /></a>
         <p>Rachel O'Meara as Agent<br>Click to see profile.</p>
       </div>
   </div>
</div>

Javascript code:

$('.small-thumb-holder').mouseover(function(){
   $(this).parent(".actor").css({width:150},100);
   $(this).hide();
   $(this).next('.big-thumb-holder').show();
});
$('.big-thumb-holder').mouseout(function(){
   $(this).parent(".actor").css({width:80},100);
   $(this).hide();
   $('.small-thumb-holder').show();
})

My attempt which does not work:

<div class="small-thumb-holder" onmouseover="(function(){
        $(this).parent(".actor").css({width:150},100);
        $(this).hide();
        $(this).next('.big-thumb-holder').show();
    };">
    <a href="" class="actor_thumb">
        <img src="images/actor-01.jpg" width="65" height="50" />
    </a>
    <h3>Lucas Allen</h3>
    as FIRST MATE KARL-CAPTAIN CARRIBEAN
</div>
<div class="big-thumb-holder" onmouseout="(function(){
        $(this).parent(".actor").css({width:80},100);
        $(this).hide();
        $('.small-thumb-holder').show();
    }">

Answer №1

Ensure that the jQuery code is executed only after the completion of popup loading, allowing the mouseover and mouseout events to properly bind to the div elements. Consider encapsulating the jQuery lines within a function and invoking it post-popup loading for seamless functionality.

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

Is it possible to devise a universal click handler in TypeScript that will consistently execute after all other click handlers?

In my ReactJS based application written in TypeScript, we have implemented various click handlers. Different teams contribute to the application and can add their own handlers as well. The challenge we face is ensuring that a specific global click handler ...

Is the alert still displayed during a frozen UI, even when it is within a synchronous ajax call?

Here is the code snippet for implementing global AJAX functionality. jQuery(function (){ $(document).ajaxStop(function() { alert("stop"); }); $(document).ajaxStart(function() { al ...

Executing a search and obtaining XML data from an external source

Currently, I am faced with the challenge of using Ajax to submit a query to an external database located at http://foreignserver:1234/database?query="SELECT FROM WHERE". The goal is to execute the query, generate an XML file, and have it returned to me. Th ...

What is the process of combining two separate req items to generate a fresh document in MongoDB?

Within my application, both req.body and req.user are available for use. I am attempting to utilize both of these to generate a new document in the system. However, it appears that the Model.create function can only accept one input parameter. What would ...

Trouble with Fetching Data by ID in MongoDB 2.0.0 Driver

In my NodeJS/Express web service project, I am using the MongoDB 2.0.0 driver to interact with the database. UPDATE: Following previous feedback, I have made changes to my code, including removing the db.close() call. Everything works smoothly when I per ...

Experiencing a problem with a jQuery script when implementing third-party pagination on

I am setting up twbs pagination, but I am having trouble with the required script. <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> The existing code I have includes this script: <script src="https://code.jquery.com/jq ...

Having difficulty accessing node_modules directory in JavaScript

I am confused about how to access node_modules for JavaScript. Can someone provide an example of calling module.exports from a node_module folder after installing a package with NPM in Node.js? File tree structure: There is a folder named 'ethereum&a ...

Using select2 scss from the node_modules folder

Looking for help with importing select2 scss from node_modules. I successfully installed the select2 by running the command: npm install select2 which created a select2 folder in the node_modules directory. Can anyone guide me on how to import the css f ...

Aligning a bootstrap grid in the center for mobile devices

I've encountered an issue where my 2×3 grid of images and text is perfectly centered on desktop but has a strange offset on mobile devices. Here's how it appears on the desktop: https://i.sstatic.net/HXqFq.jpg and here's the layout on mob ...

Delete multiple selected rows from the table

I need help with removing multiple rows from a table. I've tried the code below but it doesn't seem to work. I'm using DataTables v1.10.9. $('#del_Btn').on('click', function () { // 'table' is the instanc ...

Issue with jQuery: addClass not toggling within an IF statement

Is there a way to dynamically add the class "disable" to an anchor tag when a user selects the radio button labeled "Remove"? Currently, in the provided fiddle, the class is added as soon as the page loads. I have included code in the script that successf ...

Transforming a collection of nested objects from Firebase into an array in JavaScript/Typescript

In my Ionic3 / Angular4 application, I am utilizing Firebase. The structure of the data in Firebase Realtime Database is as follows: Using the TypeScript code below, I am fetching observable data from Firebase... getDishesCategories(uid: string) { ...

"Discover the process of utilizing jQuery to trigger an action when scrolling past a

I'm currently working with this code snippet: #main { max-width: 500px; height: 900px; margin: auto; background: green } .menu1 { height: 30px; background: red } .menu2 { display: none; } <div id="main"> <div class="menu1"& ...

What causes the sudden jump in width during a transition?

I'm having trouble with setting transitions. Everything seems to be in order and almost working, but I'm experiencing a "jumping" effect: instead of smoothly transitioning the width from 100% to 100px, it jumps from 100% to "min-content" to 100px ...

The fade effect on an element cannot be achieved using setTimeout

I'm trying to call a tooltip and hide it after 9 seconds, but for some reason, it's not working as expected. The issue I'm facing is that the "tooltip" only hides after it initially loads. It doesn't respond when I click on the "Touch ...

Access AWS Lambda environment variables in Node.js using webpack

Looking to access environment variables in Node.js with Webpack? When trying to access them using process.env null values are returned. ...

Using jQuery to follow a div while scrolling that halts at a designated top or bottom boundary

I've been working on this jsfiddle: https://jsfiddle.net/3ncyxnzt/ Currently, the red box stops at a specified margin from the top of the page but I want it to also stop before reaching the bottom, so that it doesn't go under or over the footer. ...

Using Vue.js and Laravel, you can effectively display values in a dropdown menu

Trying to display a list of countries in a dropdown menu by fetching data from a database using vue.js in laravel 7. However, the countries are not appearing in the dropdown. Code Snippet: <template> <div class="col-md-6 pull-right"> ...

VSCode is experiencing issues with recognizing .env* files for markup purposes and is also failing to recognize .env.local.* files

Current Environment: Utilizing NextJs, React, and VsCode Noticing a problem with syntax highlighting in my VSCODE editor. I have installed the following extensions: ENV DotEnv As per suggestions, I updated my json configuration file as follows: " ...

Struggling to make vue-i18n function properly with nuxt generate?

In an effort to enhance my skills, I am creating a small Nuxt project from scratch. While the project runs smoothly on the local server, I have encountered an issue with the language switcher not updating the translation fields when using nuxt generate. U ...