Drop down feature with interactive tool tips for dynamic values

While buttons and other HTML components with unique design tooltips are working fine, implementing them on dynamic dropdowns or simple components seems to strip away the design. Here is an example:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
            $('[data-toggle="tooltip"]').tooltip();
       });
</script>

Any suggestions on how to achieve a unique design for tooltips on dropdowns? My goal is to have tooltips with a combination of text and image when users hover over each value in the dropdown. Thanks in advance!

Answer №1

According to the guidelines in the bootstrap Documentation, it is advised to include popper.min.js before bootstrap.js for the following purposes:

  • Ensuring proper display and positioning of tooltips and popovers (Popper.js is also required)
  • Ensuring proper display and positioning of dropdowns (Popper.js is also required)

To access the Bootstrap Documentation, visit: https://getbootstrap.com/docs/4.2/getting-started/introduction/#js

If you are looking for something similar to your requirements, you can check this link:

Answer №2

$('a[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'top',
html: true
});
.avatar {
  vertical-align: middle;
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <text>Demonstration of a Simple Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.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.4.1/js/bootstrap.min.js"></script>
</head>

<body>

 

    <a href="#" data-toggle="tooltip" title="<img class='avatar' src='https://www.w3schools.com/w3images/avatar5.png'/> <span><br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry.</span>">
       Anonymous
    </a>

 

Why not give the latest version of bootstrap a shot? If not, feel free to try this out. Hopefully, it will be helpful.

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

The CSS background image is not displaying, but when I place it as a regular image, it does show up

My CSS code at the root of the file is set up to check the issue I'm about to explain: .why-choose-us-image { width: 100%; height: 100%; background-position: center center; background-size: cover; background-repeat: no-repeat; } . ...

How can I use Beautiful Soup to change the value of a dropdown button to match the selected dropdown

Is there a way to have my BS4 dropdown menu display the selected value in the dropdown toggle button, specifically .dropdown-toggle? A similar question was asked before here, but it pertains to an older version (BS3 Framework) and does not address using t ...

Creating an HTML table from a JSON file: Step-by-step guide

I am trying to create a code snippet that populates a table with data from specified .json files in the 'tracks' folder. The JSON file format looks like this: { "EndTime": "11:00", "Person": [ { ...

Align elements vertically in flexbox container using Bootstrap 3 on Internet Explorer 10 and 11

Encountering a problem in IE10+11 when trying to vertically center two Bootstrap columns within a row using flexbox. The dynamic content in the columns requires the row to have a minimum height of 65px. However, if the content expands and spans multiple l ...

Attempting to switch a jQuery element's visibility from hidden to visible

Just starting out with Jquery and running into an issue. The errorSummaryDiv element on my webpage is not showing up as intended. I've been trying to write the code that will change the display attribute from 'none' to 'block', or ...

Accessing geolocation on a mobile web browser: A step-by-step guide

I have implemented HTML5 geolocation functionality using code I found in the documentation: getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(this.showPosition, this.showError); } else { alert("Geoloc ...

Maintaining the position of the screen as you type in information that is located outside of the container

I am encountering an issue with the input/text-area element in absolute position extending halfway outside the container. The screen position seems to follow the caret as I type, but I'd prefer to keep writing and have part of the text hidden beyond t ...

What could be the reason for foundations occasionally failing to size columns equally?

Check out this foundation JSFiddle I created: http://jsfiddle.net/nycynik/qn8z3cut/2/ When I view it, the layout doesn't resemble tic-tac-toe at all. The right column is aligned to the right, and the sizes of the other columns are all different. I wa ...

Clicking on elements within a Scrollview does not work when the Scrollview is set to an

Currently, I am facing an issue with my Scrollview as its children are not clickable despite having a position of absolute. Click events seem to just pass through them and interact with components below. I have searched extensively for a solution online, b ...

Using JavaScript to close a menu when clicking outside of it

I am currently working on enhancing a menu with a basic functionality. The goal is to toggle the menu between showing and hiding when a button is clicked, managed by a CSS class using JavaScript. However, I have encountered an issue when attempting to com ...

bulk upload with the ability to remove files

I'm in the process of creating a multiple file upload with delete option, similar to the design shown in this image: https://i.sstatic.net/RomOR.jpg I have been following an example on this JS Fiddle demo. My goal is to eliminate the button with the ...

Different methods of displaying the next image from a URL without explicitly setting the dimensions

I am attempting to display an image in Next.js without specifying the width and height by using import Image from 'next/image';. It should be noted that the image is sourced from a URL, not a specific folder within the project. <Image si ...

Adding multiple styles using ngStyle is currently not possible

When using ngStyle to add height and width styles to an img element, I encountered a strange issue: <img class="image-full-view" [ngStyle]="{'height': selectedImage.heightSize, 'width': selectedImage.widthSize}" [src]="selectedImage ...

A date picker pops up when the user clicks on an Angular input field of type text

I am looking to edit a dateTime value using Angular/Ionic, but unfortunately there is no dateTime picker available. To work around this issue, I have split the field into separate date and time fields. In order to incorporate placeholder text and format th ...

Troubles with Marquee Element

Being a beginner in the world of html and css, I have encountered an issue while creating a responsive web page. At the top of my page, there is a text within a div which gets cut off from the right side as I decrease the browser width. Initially, I cons ...

What are the steps to utilize the latest Bootstrap 5 features for converting a vertical stack of div elements into a dynamic masonry layout

Currently, I am customizing a theme template for blogger.com and I want the blog posts on the home page to be displayed in a masonry layout similar to the one in the provided image. Blogger's limitations make it challenging to calculate the necessary ...

Header Button and Dropdown Divs Alignment

Currently, I am working on creating a three-button system to showcase the collectibles in my game's website. I have the buttons prepared, but the one on the right flies off the screen, and the middle button appears misaligned. My goal is to design a ...

"Enhance your design with a custom-made box layout using Bootstrap

I am trying to create a bootstrap responsive layout with four center-aligned boxes, each containing an image and text. However, the boxes are not displaying properly and there is no space between them. Please refer to the attached image for reference. Thi ...

The dynamic form will not display the currency format

Could anyone assist me with this code, please? var sum = parseInt($("#jumlah-form3").val()); var nextform = sum + 1; $("#insert-form3").append( " <tr id='layanan"+nextform+&qu ...

What is the best way to incorporate next and previous buttons into my slideshow using jQuery?

Looking to enhance my slideshow by incorporating the ability to pause, go to the next or previous image, along with the automatic transitioning feature currently in place. I'm a bit unsure on how to implement these event handlers efficiently within my ...