Accordion with Tooltips

Exploring the possibilities of Accordions and Tooltips, I aim to create an accordion element with a table containing information. The idea is to add a question mark icon on the right side, which will serve as a Tooltip when hovered over.

After designing the layout and following Bootstrap 4 documentation, I encountered difficulties in implementing a functional tooltip feature.

Here is the HTML code:

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Testing Page for Tooltips</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />

            <!-- LINKS FOR DOCUMENT/CODE -->
        
        <link rel="stylesheet" type="text/css" href="Tooltips.css" />
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
        <script src="https://kit.fontawesome.com/b60e607f25.js" crossorigin="anonymous"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
                <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
        
    </head>
        <body>
                    <table class="table table-dark">
                      <thead>
                        <tr>
                          <th scope="col">Description</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <th scope="row" style="font-weight: 400;">1(01)</th>
                          <td>Information <span class="arrow" style="float: right; font-size: 20px; color: deepskyblue;"><a data-toggle="tooltip" title="Hello-World"><i class="fas fa-question-circle"></i></a></span></td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
    </body>
    
    <!-- JAVASCRIPT SCRIPTS -->
    
    <script>
    $(document).ready(function(){
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>
</html>

CSS Styling:

.accordion {
    margin: 3vw;
    border: #383838;
}

.card-header.collapsed {
    background: #343a40;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.8);
    
}
.card-header:not(.collapsed) {
    background:#343a40;
    border-bottom: transparent;  
}

If anyone can provide guidance on getting the tooltip functionality to work, it would be greatly appreciated.

Answer №1

You may achieve the desired outcome by excluding this particular line from your script references:

        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

After eliminating it, the functionality should align with your expectations.

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

No content displayed as I adjust the height of a child element

Oftentimes, I find myself wanting to create a clean and simple web page layout using flexbox. Here's an example of what I'm aiming for: https://i.sstatic.net/0xYX5.png Here is the code snippet I have tried so far: .container { height: 10 ...

When you adjust the size of your web browser, the text may become distorted in HTML and CSS

My website has a problem with text resizing when the browser window is made smaller. The text gets squashed in the middle and creates more lines than needed. Here is my code: Entire Document HTML: http://pastebin.com/kj1jvTjv CSS: http://pastebin.com/A1C ...

The div is lacking in height

I have 3 divs that belong to the stackContainer class: .stackContainer { position: relative; } Within these divs, I want multiple elements stacked on top of each other. To achieve this, I use the following code: .stackItem { position: absolute; ...

Merge multiple echoes to create a single echoed string that is valid HTML

<?php // link to Google Docs spreadsheet $url='https://docs.google.com/spreadsheets/d/1_4d-MPxTUOVZbxTOlhjXv1ebTlBPQ-_JrYUlS1rqX5Q/pub?output=csv'; // open file for reading if (($handle = fopen($url, "r")) !== FALSE) { while (($data = fge ...

Align the items at the center of a Vue Router Link

I am looking to design a navigation bar that includes router-link items, with each item displaying an icon on the left side and text on the right side. An example of this design can be seen in the Firebase navigation bar. https://i.sstatic.net/eg328.png ...

IE11 causing issues with Bootstrap/Angular dropdown functionality

Is there a workaround for the issue with the selected menu item not showing in IE11 for this simple drop-down? <div class="form-group program-container"> <select class="form-control container-fluid" (change)="onChooseMe ...

Is there a way to display a bootstrap modal when the page is refreshed?

Is there a way to automatically display a Bootstrap modal box without the need for clicking anywhere? I want the modal to appear every time the page is refreshed, rather than requiring a click event. Can anyone provide guidance on achieving this? < ...

Tips for resolving table header issues and enabling vertical movement of data while simultaneously allowing both the header and data to move vertically

I need assistance with a challenge I am facing. I have created a table using HTML tags, and now I want to add a vertical scrollbar to the browser without affecting the table's header. The data in the table should move when the vertical scrollbar is us ...

Custom Jquery function is failing to position divs correctly within ajax-loaded content

I recently coded a custom function that efficiently positions absolute divs within a container by calculating top positions and heights: $.fn.gridB = function() { var o = $(this); //UPDATED from var o = $(this[0]); o.each(function() { var ...

The z-index of the fixed header in FullPageJS is causing the section's content to be hidden

For my current project, I am incorporating FullPageJS and using a fixed top menu that adjusts its height based on the viewport size. On smaller screens, the menu items will be stacked on top of each other, while on wider screens, the menu items will be po ...

I am looking to build an array that can store five numbers inputted by the user. Following that, I want to utilize a for loop to display the contents of the array. How can I accomplish this task?

Looking for help to store 5 unknown numbers in an array and then display them after the user has entered all 5 numbers. Can anyone assist me in creating an array of size 5 and using a for loop to show the numbers? Here is the code I currently have: ...

Navigating to external URLs using a Form-based approach in .NET Framework

Is it possible to direct to an external website using a URL as a Command Argument? I attempted to redirect to facebook.com, but it resulted in http://localhost:58709/www.facebook.com%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20% ...

HTML with embedded PHP script

i cannot seem to display mysql data in html format. the table i am working with is called App appid | app | version | date | apk file | 1 sample 1.0.0 2012-10-12 sample.apk //here is the mysql query ...

The size of the search input and textarea in HTML decreases when viewed on an iPad device

Currently utilizing Bootstrap 3 and AngularJs for this project. Implementing the following markup for the input field with type 'search': <input type="search" class="form-control" id='roomSearch' placeholder="Search" ng-model=&apo ...

javascript basic image carousel

How can I modify my slider so that "slide 1" appears after "slide 3" without needing to use the return or previous button each time? I'm not very well-versed in javascript, so I thought I'd reach out for some assistance ...

Angular: bypassSecurityTrustHtml sanitizer does not render the attribute (click)

I'm facing an issue where a button I rendered is not executing the alertWindow function when clicked. Can anyone help?: app.component.ts: import { Component, ElementRef, OnInit, ViewEncapsulation } from '@angular/core'; import ...

Align a series of divs in the center with variable width and height

I have a dilemma with my large div that contains multiple thumbnails. I am looking to center the thumbnails within the div and have the overall div centered on the page. Additionally, I want the width of the div to be flexible so that all thumbnails can be ...

Shrink image sizes using PHP

Currently I am trying to find a way to decrease the sizes of images using PHP when the page loads. Despite obtaining the dimensions, I am uncertain about how to proceed with reducing their sizes in PHP. Below is my existing code: <?php $stmt = $db-> ...

Pure CSS tab system that prevents label propagation using anchors

I am in the process of creating a tab system using only CSS with the help of the :target and :checked pseudo classes. However, I have encountered an issue where an anchor inside the label is not triggering the :checked. When clicking on the anchor, the :c ...

Position the float input to the right on the same line as an element

This Angular code contains a challenge where I aim to have text at the start of a column and an input box on the right side of the page, both aligned on the same line. The issue lies in the code which floats the input to the right but disrupts the alignme ...