Display the Bootstrap datetimepicker within a div when hovering the mouse over it

Encountering an issue with the datetimepicker functionality in Bootstrap. There is a table with a list of items, each column having an input field for searching through the data. Specifically, I need to search within a date range for the "creationDate" field. To save space, I have an icon that displays a div with two inputs and datetimepicker when hovered over.

The code snippet for this section is as follows:

<td>
    <img src="/assets/css/images/unroll-icon.png" ng-mouseenter="showSelectCreationDate()" />
    <div class="selectCreationDate" id="selectCreationDate" ng-mouseleave="hideSelectCreationDate()">
        Date min. :
        <input type='text' data-date-format="DD/MM/YYYY" class="form-control" id='inputCreationDateMin' />
        <br />Date max. :
        <input type='text' data-date-format="DD/MM/YYYY" class="form-control" id='inputCreationDateMax' />
        <script type="application/javascript">
            $(function () {
                $('#inputCreationDateMin').datetimepicker({
                    pickTime: false
                });
            });

            $(function () {
                $('#inputCreationDateMax').datetimepicker({
                    pickTime: false
                });
            });
        </script>
    </div>

</td>

Encountering a problem where moving the mouse within the datetimepicker popup triggers a mouseleave event from the parent div, causing it to disappear and hindering date selection.

Answer №1

Here's a solution for the issue of hiding popups when mousing over an id/class:

    $(document).on("mouseover", "#nameOfyourField", function (e) {           
        //Implement your desired actions here
    });

To make the popup disappear when clicking somewhere on the webpage, you can use this code:

        $(document).on("click", "body", function () {
        $("#nameOfyourField").hide();
    });

I hope this helps resolve your problem effectively.

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 adjust the range of a range slider based on the selection of a radio button or other input method?

I have a query and I’m hopeful you can assist: function UpdateTemperature() { var selectedGrade = $( "input[name='radios']:checked" ).val(); $( ".c_f" ).text(selectedGrade); var value1 = $("#tempMin").val(); var value2 = $("#tempM ...

Modify the appearance of the element that is currently chosen

I have a navigation menu and I would like to change the style of the element that is selected from the list in the navigation menu. I am using React with the Grid element from material-ui. NavigationMenu.tsx: import React, { useState, useEffect } from "r ...

spaces between sections with no padding or borders

I came across the following layout on the web and noticed that the divs do not align perfectly. The top of a lower div does not touch the bottom of the div above it when borders are removed, although they do when borders are added. There seems to be an i ...

Tips for generating documentation using markdown within the docs directory on GitHub with the help of JavaScript

After browsing through numerous documentation websites, I have noticed that many of them share the same layout and features. This has led me to question whether there is a common library used by all these documentation sites. How do they achieve this unif ...

The information is not being stored in Excel despite the fact that the Excel document has been generated with a header

I have been working on a project that involves fetching book details from the Google Books API and using generative AI to create descriptions for them. I have successfully created an Excel file, but I am facing an issue with saving data inside it. It' ...

Clicking on a JQuery dropdown menu will always result in it staying open

After creating a dropdown menu click, I noticed some strange behavior. When I click the dropdown button, the menu appears as expected. However, if I move my cursor away without clicking the button again, the dropdown menu disappears and behaves like a hove ...

Audio transition on hover over image

I'm currently designing a website and I have an image depicting a house with windows. I would like to create an interactive element where the face of Goldilocks pops up in one of the windows on mouseover, accompanied by sound. I envision the face movi ...

What are the steps to getting Jarallax MDB up and running?

This is the code I am currently working with: <div class="view jarallax" data-jarallax = '{"speed":0.2 }' style="background- image: url('OFP/OFP_Group.jpg'); background-repeat: no-repeat; background- size: cover; background-positi ...

What is the method for applying border-corner-radius exclusively to the left side of a button using jquery-ui-1.9.2.custom?

In my HTML code, I have the following: <div id="ot-lang-src"> <button id="rerun"></button> <button id="select">Choose a language</button> <ul id="ui-menu-left"> < ...

What is the method to adjust the color of items within a <select> dropdown menu?

Feeling stuck with a real problem! I have no clue how to solve it... Is it even possible? I want the text in this menu to be white: https://i.sstatic.net/wTqRo.png This is my code: <select id="addRow-fieldType" style="margin-top: 10px; width: 180px; ...

Adjust the font sizes in Bootstrap4 to be in proportion with the Scss $font-size-base

I am currently customizing Bootstrap4 and facing challenges in understanding why certain elements are not functioning as anticipated. When modifying the original _variables.scss file by adjusting the $font-size-base, ideally, it should reflect across rela ...

The performance and loading speed of Kendo Scheduler is significantly impacted when handling a large amount of data

Within our application, there exists data for over 200 rooms. This data is fetched from the backend in a single API call, encompassing a specific date range (typically 10 to 15 days) and containing a significant amount of information. However, when attempt ...

Emphasize the close button within the popup window as soon as it appears

One of my coding challenges involves a div element, shown below: <div id="modal" tabindex="-1" ng-show="booleanvariable"></div> When the value of ng-show is true, this div is displayed. A "close" button located under the div should be focused ...

Make the text appear hazy as it moves behind a see-through object

I'm attempting to create a blurred text effect that transitions behind a semi-transparent container label. I've experimented with combining the backdrop-filter and filter properties along with the filter function blur(), but I haven't been ...

Achieving full width for the elements in a row with Flexbox: A step-by-step guide

I am dealing with a flexbox grid that contains random width images: https://i.stack.imgur.com/pfPeU.jpg I want to stretch the elements in each row to full width to eliminate any white space - Is there a way to achieve this using CSS? justify-content do ...

Can someone please provide guidance on how to focus on these boxes? (see image below)

My goal is to specifically target the boxes with white dots inside them. Each black box in this picture represents a blog post, even including the larger one at the top. I initially considered using the nth-child selector, but I'm not confident in how ...

Exploring the semantics of CSS documents

Picture this scenario: I have a massive CSS file with over 40,000 lines, like the one found at https://cdn.jsdelivr.net/npm/[email protected] /dist/semantic.css I need to sift through this file and specifically search for class definitions that inclu ...

AngularJS: Retrieve country, state, and city data from a database for selection

I am looking to implement a country, state, and city selection feature on my website. I already have separate tables for countries, states, and cities in my database. City Table CREATE TABLE IF NOT EXISTS `cities` ( `city_id` int(11) NOT NULL, `city_ ...

AngularJS - Strange bug encountered when transferring and removing JSON data from cache within a loop structure

The loop is exhibiting odd behavior where the alerts are triggering out of sequence and the JSON data is all being sent simultaneously. I can't figure out why this is happening. I've been grappling with this issue for a while now and any assistan ...

unable to properly display application.html.erb

I am encountering difficulties in rendering my application.html.erb template as I am receiving the following error message: ActionView::SyntaxErrorInTemplate within ApplicationController#home app/views/layouts/application.HTML.erb:10: syntax error, unexpec ...