Following is the entirety of the document I'm working on:
Expand|Select|Wrap|Line Numbers
- <head>
- <style type="text/css">
- #tooltip_div
- {
- position: absolute;
- visibility: hidden;
- z-index: 20;
- top: 0px;
- left: 0px;
- }
- .tooltip_table
- {
- border: 0px;
- width: 250px;
- height: 80px;
- margin: 0px;
- padding: 0px;
- background-color: #404040;
- background: url('table_bg.PNG');
- color: #aaaaaa;
- }
- .tooltip_head
- {
- border: 0px;
- text-align: center;
- vertical-align: middle;
- height: 10px;
- font-family: verdana,sans-serif;
- font-size: 10px;
- background: url('title_bg.PNG');
- background-color: #808080;
- color: #aaaaaa;
- }
- .tooltip_content
- {
- border: 0px;
- margin: 0px;
- text-align: center;
- vertical-align: middle;
- font-family: verdana,sans-serif;
- font-size: 10px;
- color: #aaaaaa;
- }
- </style>
- <script type="text/javascript">
- if(!document.all) document.captureEvents(Event.MOUSEMOVE);
- document.onmousemove = realign_tooltip;
- var body_width = 0;
- var body_height = 0;
- var tooltip_x_offset = 15;
- var tooltip_y_offset = 15;
- var tooltip_div;
- function init_tooltip()
- {
- if(document.all)
- {
- body_width = document.body.clientWidth;
- body_height = document.body.clientHeight;
- }
- else
- {
- body_width = window.innerWidth;
- body_height = window.innerHeight;
- }
- }
- function show_tooltip(title,content)
- {
- tooltip_div = document.getElementById('tooltip_div');
- tooltip_div.innerHTML = ('<table class="tooltip_table"><tr><td class="tooltip_head">'+title+'</td></tr><tr><td class="tooltip_content">'+content+'</td></tr></table>');
- realign_tooltip();
- tooltip_div.style.visibility = 'visible';
- }
- function hide_tooltip()
- {
- tooltip_div.style.visibility = 'hidden';
- tooltip_div = null;
- }
- function realign_tooltip(ev)
- {
- ev = (ev || window.event);
- init_tooltip();
- if(tooltip_div)
- {
- if(document.all)
- {
- tooltip_div.style.left = ((((ev.clientX+tooltip_x_offset+tooltip_div.clientWidth) <= body_width) ? (ev.clientX+tooltip_x_offset) : (body_width-tooltip_div.clientWidth))+'px');
- tooltip_div.style.top = ((((ev.clientY+tooltip_y_offset+tooltip_div.clientHeight) <= body_height) ? (ev.clientY+tooltip_y_offset) : (body_height-tooltip_div.clientHeight))+'px');
- }
- else
- {
- tooltip_div.style.left = ((((ev.pageX+tooltip_x_offset+tooltip_div.clientWidth) <= body_width) ? (ev.pageX+tooltip_x_offset) : (body_width-tooltip_div.clientWidth))+'px');
- tooltip_div.style.top = ((((ev.pageY+tooltip_y_offset+tooltip_div.clientHeight) <= body_height) ? (ev.pageY+tooltip_y_offset) : (body_height-tooltip_div.clientHeight))+'px');
- }
- document.getElementById('debug').innerHTML = (''+body_width+'x'+body_height+'<br>'+tooltip_div.style.left+', '+tooltip_div.style.top);
- }
- }
- </script>
- </head>
- <body onload="init_tooltip();">
- <a href="#" onmouseover="show_tooltip('Total mutes','This is the total number of automated mutes currently being applied. This number does not include mutes by staff or those who have logged out before an auto-mute expired.');" onmouseout="hide_tooltip();">blah</a>
- <br><br><br><br><a href="#" onmouseover="show_tooltip('lol','More text');" onmouseout="hide_tooltip();">lol</a>
- <br><br><br><br><div id="tooltip_div"> </div>
- <div id="debug">0,0</div>