Solved

Not want transparent background...

Posted on 2011-03-24
12
241 Views
Last Modified: 2012-06-27
Hi!

Have this page:
http://www.gaardsand.no/Artiklergaard.htm

If you try to focus with the mouse over:
41010       ANDEPØLSE, 5x1kg       ca 5,00       48       KG       Melk og sulfitt       

Les mer... -> show a textbox, but text under is shown in the box ?
How can i fix this ?

0
Comment
Question by:team2005
  • 5
  • 5
  • 2
12 Comments
 
LVL 9

Expert Comment

by:McOz
ID: 35206324
In your CSS (tested and works in IE8):

Change:
.ToolTextHover {
	POSITION: relative
}

Open in new window

To:
.ToolTextHover {
	Z-INDEX: 1; 
         POSITION: relative
}

Open in new window


The z-index will make these other labels stay behind the tooltip span.

Cheers
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35206370
Agree,

change
.ToolTextHover
{
 position:relative;
 z-index: 1;
}
0
 
LVL 2

Author Comment

by:team2005
ID: 35208048
Hi!

Cant use this, not a good solution
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35208102
Why you can't use this?

isn't it working?
0
 
LVL 9

Expert Comment

by:McOz
ID: 35208172
team2005,
the solution that I supplied is the best answer to your question. Unless it does not work, it is by far the simplest way to resolve the issue, which is not really about transparency of the tooltip span, but simply the order of elements. Without the z-index, the other labels end up in FRONT of the tooltip by default.

Let me know what the issue is, and we will see what can be done.

Thanks
0
 
LVL 2

Author Comment

by:team2005
ID: 35208240
Want the same effect that i have now, but the text under the tooltip
must not bee shown in this tooltipbox.

Maby use the same effect as with the pictures.
Use the same effect as the picture. But only show text..
Is that possible ?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 9

Expert Comment

by:McOz
ID: 35208311
Like this? screen capture
0
 
LVL 2

Author Comment

by:team2005
ID: 35208530
Yes, but now expand the row...
0
 
LVL 9

Expert Comment

by:McOz
ID: 35208577
team, thanks for getting back to me. The image above was achieved using the method I showed you above (adding z-index:1 to the CSS definition).

I'm not quite sure what you mean by "expand the row", you would be welcome open another question to deal specifically with that, as it seems to go beyond the scope of this question.

Best regards,
Oz
0
 
LVL 2

Author Comment

by:team2005
ID: 35213253
Hi!

Want the same effect as used on the pictures.
But must use text only, and not picture.
How to do this ?
0
 
LVL 9

Accepted Solution

by:
McOz earned 500 total points
ID: 35258961
OK, its a little more involved, but here goes:

1) Do the CSS change pointed out above (set z-index of labels to 1). This must be done, or they will always be on top.

2) in your js, change the following functions:
Replace
function showtrail(width,height,file)
{
if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
{
w=width
h=height
// followmouse()
gettrailobj().visibility="visible"
gettrailobj().width=w+"px"
gettrailobj().height=h+"px"
document.getElementById('ttimg').src=file
document.onmousemove=followmouse
}
}

Open in new window

With
function showtrail(width,height,file)
{
if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
{
w=width
h=height
// followmouse()
gettrailobj().visibility="visible"
gettrailobj().width=w+"px"
if(file.match(/^htt.*:\/\/|^\//))
{
gettrailobj().height=h+"px"
document.getElementById('trailimageid').innerHTML='<img id="ttimg" src="'+file+'">'
}else{
gettrailobj().height="auto"
document.getElementById('trailimageid').innerHTML='<div class="trailText">'+file+'</div>'
}
document.onmousemove=followmouse
}
}

Open in new window


And replace
function hidetrail()
{
document.onmousemove=""
document.getElementById('ttimg').src='img/s.gif'
gettrailobj().visibility="hidden"
gettrailobj().left=-1000
gettrailobj().top=0
}

Open in new window

With
function hidetrail()
{
document.onmousemove=""
gettrailobj().visibility="hidden"
gettrailobj().left=-1000
gettrailobj().top=0
}

Open in new window


3) then, add a CSS class to define how the tooltip should look (you can adjust this):
.trailText {
   padding: 10px;
   color: red;
   background: white;
}

Open in new window


4) finally, change the onmouseover and onmouseout attributes of all the tooltip labels to this:
onmouseover="showtrail(300,500,this.childNodes[1].innerHTML);" onmouseout="hidetrail();"

Open in new window


Good luck, this is tested and works in FF 4, and should work in most other browsers as well.
0
 
LVL 2

Author Closing Comment

by:team2005
ID: 35400262
thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Javascript - getdate 5 51
spacing 5 27
Syntax Error 6 30
Scrolling the scrollbar in a list in html 9 29
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now