Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltips cutoff in container

I'm using Bootstrap tooltips, and they are currently being cut off on my page. I removed overflow-x properties to try to ensure that the tooltip is visible, but they are still being cut off:

enter image description here

I've looked up some possible solutions, but I can't set the position of the tooltips to fixed or change the parent of the tooltips because they need to scroll with the elements in my container:

https://www.youtube.com/watch?v=qoNkpFAHr0o&feature=youtu.be

Here is how I add the tooltips:

$('#step_name').tooltip(
{
    title: "1. Add step title",
    placement: "left",
    container: ".editDetailView",
    trigger: "manual",
    position: "absolute"
});
$('#uploadMedia').tooltip(
{
    title: "2. Upload images/videos",
    placement: "left",
    container: ".editDetailView",
    trigger: "manual",
    position: "absolute"
});
$('.detailViewText').tooltip(
{
    title: "3. Add step description",
    placement: "left",
    container: ".editDetailView",
    trigger: "manual",
    position: "absolute"
});
$('.update_step_button').tooltip(
{
    title: "4. Click to create step",
    placement: "bottom",
    container: ".editDetailView",
    trigger: "manual",
    position: "absolute"
});

Here is the CSS on the container elements:

.processBlog{
    position: absolute;
    overflow: auto;
    form{
        overflow: auto;
        .stepDetailView{
           overflow-y: auto;
           .editDetailView{
               position: relative;
               overflow-y: hidden;
             }
            }
        }
}
like image 216
scientiffic Avatar asked Aug 29 '15 15:08

scientiffic


2 Answers

This can be fixed either with JS or via data-container attribute

JS method

$(element).tooltip({
         title: "Some text",
         container: "body"
});

Using data-container example

<a href="#" data-toggle="tooltip" 
            data-placement="top"
            data-container="body" 
            title="I am a tooltip">Tooltip</a>
like image 94
kiranvj Avatar answered Sep 19 '22 15:09

kiranvj


Try setting the container option for the tooltip:

$(element).tooltip({
         title: "Title",
         container: "#calendar"
});

Note: You'd want to use a container that is above the container cutting off the image.

See the options here: http://getbootstrap.com/javascript/#tooltips-options

Before/After Photo

Before After

like image 43
Loren Avatar answered Sep 21 '22 15:09

Loren