Solved

How do I make this floating jQuery tooltip opague?

Posted on 2009-05-14
4
628 Views
Last Modified: 2012-05-07
http://community.wacom.com/work

Each one of the work items have a hidden div that is shown when the mouse is hovering over the div. I wrote this functionality in jQuery. Works fine in Firefox, Safari, and IE6. However, in IE7 and IE8, the floating div is transparent when it shouldn't be. I have exhausted all of my options. I need fresh pairs of eyes on this problem. Can anyone help?
/* JQUERY/JAVASCRIPT */
 
 
function loadHovertip() {
    $("div.hovertip").hover(
		function() {
		    hovertipShow(this);
		},
		function() {
		    hovertipHide(this);
		}
    );
    
    $("img.hovertipImg").hover(
		function() {
		    hovertipShow($(this).parent().parent().next().children("div.hovertip"));
		},
		function() {
		    hovertipHide($(this).parent().parent().next().children("div.hovertip"));
		}
    );
}
 
 
function hovertipShow(pDiv) {
	$(pDiv).addClass("hovertipHover");
	$(pDiv).children("div.hoverhide").hide();
	$(pDiv).children("div.hoveronly").show();
}
 
 
function hovertipHide(pDiv) {
	$(pDiv).removeClass("hovertipHover");
	$(pDiv).children("div.hoveronly").hide();
	$(pDiv).children("div.hoverhide").show();
}
 
 
/* CSS */
 
 
.hovertip,
* html .hovertipContainer
{
	position: static;
	z-index: 5;
	
	float: left;
}
	.hovertipHover
	{
		position: absolute;
		z-index: 80 !important;
		
		float: left;
		
		width: 180px;
		padding: 5px;
		
		background: #ffffff !important;
		border: 1px solid #d0d0d0;
	}
 
.hovertip div.hoveronly
{
	display: none;
	margin: 5px 0;
	background: #ffffff !important;
}
.hovertip span.hoveronly
{
	display: none;
	background: #ffffff !important;
}

Open in new window

0
Comment
Question by:eroi
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:alien109
ID: 24390585
I think your issue is z-index, not opacity. Try tweaking the z-index.
0
 

Author Comment

by:eroi
ID: 24390943
I have tweaked the z-index numerous times. Doesn't seem to work.
0
 
LVL 12

Expert Comment

by:alien109
ID: 24394968
The tooltip's background is actually opaque. I've verified this using debug tools. Look at the tooltip when it opens, it is actually underneath the thumbnails below it.

I'd make sure that the script isn't overriding the z-index, that the script is not setting the position of the element back to static, and the stacking context of the elements. it could be you're setting the z-index of the tip inside of a parent element, which is actually behind another element.

it's hard to debug exactly what is going on.
0
 

Accepted Solution

by:
eroi earned 0 total points
ID: 25608063
We have implemented a different tooltip library. Thanks for the help.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding 1 the value of input "text" every 3 seconds 5 31
Github api to fetch the number of collaborators in a git repo 1 25
JS library vs Js framework 11 19
Use Mid in Html 6 21
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question