enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

Tooltip is hidden behind a window #29

Closed nillerch closed 11 years ago

nillerch commented 11 years ago

Hi I am trying to use opentip in my project. It works fine in the base window of the form, however if I use it on elements placed in a windows that I open in my js code, the tooltip text displays behind the "popup" window, I have tried to set the z-index in opentip.css to 2147483647 but it stills show the tooltip text behind the window.

thx for your help

Torben

enyo commented 11 years ago

Hi, Opentip sets the zIndexes programmatically so Opentips that are created later have a higher zIndex. To increase the initial zIndex, set it on the Opentip object itself like this:

Opentip.lastZIndex = 100000;
nillerch commented 11 years ago

Thx, I tried to set the Zindex as suggested but still the tooltip goes behind the window, I also tried to create the opentip object after the windows has been opened also with the same result. I have created a generic example with the Kendo UI widget library I uses to create the popup window, but cannot see any possibility to upload the example files here ? But here is my JS code:

$(document).ready(function () { var window = $("#eventWindow"); window.kendoWindow({ width: "300px", height: "315px", title: "Tooltip always goes behind", actions: ["Refresh", "Maximize", "Close"], visible: false, });

window.bind("activate", openeventwindow);

function openeventwindow(args) { var myOpentip = new Opentip($("#message")); myOpentip.lastZIndex = 100000; myOpentip.setContent("New Tootip contents always goes behinf the window"); }

$("#Buttontest").bind('click', function() {
     window.data("kendoWindow").open();
});

});