within text in your body: Link */ // Global variables xMousePos = 0; // Horizontal position of the mouse on the screen yMousePos = 0; // Vertical position of the mouse on the screen xMousePosMax = 0; // Width of the page yMousePosMax = 0; // Height of the page infoElement= null; // node of the Div-Layer that shows the information xFromMouse=0; yFromMouse=0; yUpFromMouse=37; standardStyle='position:absolute;left:0px;top:0px;visibility:hidden;text-align:center;z-index:999;'; vars=new Object(); vars.tags=[ 'a' ,'area', 'td', 'img']; // array of tag-names that should provide information vars.infoAttributeName= 'info'; // in the tags the attribute that contains the text to show vars.infoElementCentered= true; // centered relative to mouse-pointer vars.infoElementId=null; // use this div-Tag for the id to show information, null->create new one vars.infoElementStyleClass=null; // use this CSS-class if no Id is defined, do not forget padding vars.infoElementFontSize= '12px'; // use if no Id and no CSS-class is defined vars.infoElementTextColor='#000000'; vars.infoElementBGColor= '#FFFFE1';// // use if no Id and no CSS-class is definded function setVariables(){ var settings= window.infoSettings; // infoSettings is optional object that contains user variables // insert infoSettings before adding link to this js-file if( settings==null ){ // default values are used } else { for( var varName in settings ){ if( settings[varName]!=null ) vars[varName]= settings[varName]; } } }; setVariables(); begin(); function begin(){ attachInfoElement(); installTagListeners(); oldOnmousemove= document.onmousemove; if (document.all) { // Internet Explorer yFromMouse=17; xFromMouse=2; document.onmousemove = captureMousePosition; } else if (document.getElementById) { // Netcsape 6 + Mozilla yFromMouse=21; xFromMouse=2; document.onmousemove = captureMousePosition; } } function captureMousePosition(e) { if ( document.documentElement&& window.event&& document.documentElement.clientWidth>0 ){ // IE6 (sometimes) xMousePos = window.event.x+ document.documentElement.scrollLeft; yMousePos = window.event.y+document.documentElement.scrollTop; xMousePosMax = document.documentElement.clientWidth+document.documentElement.scrollLeft; yMousePosMax = document.documentElement.clientHeight+document.documentElement.scrollTop-12; } else if (document.all) { // When the page scrolls in IE, the event's mouse position // reflects the position from the top/left of the screen the // user is looking at. scrollLeft/Top is the amount the user // has scrolled into the page. clientWidth/Height is the height/ // width of the current page the user is looking at. So, to be // consistent with Netscape (above), add the scroll offsets to // both so we end up with an absolute value on the page, no // matter if the user has scrolled or not. xMousePos = window.event.x+document.body.scrollLeft; yMousePos = window.event.y+document.body.scrollTop; xMousePosMax = document.body.clientWidth+document.body.scrollLeft; yMousePosMax = document.body.clientHeight+document.body.scrollTop; } else if (document.getElementById) { // Netscape 6 behaves the same as Netscape 4 in this regard xMousePos = e.pageX; yMousePos = e.pageY; xMousePosMax = window.innerWidth+window.pageXOffset; yMousePosMax = window.innerHeight+window.pageYOffset; } moveElements(); if( oldOnmousemove!=null ){ oldOnmousemove(e); } } function out( string ){ var outDiv=document.getElementById('out') if(outDiv!=null) outDiv.firstChild.nodeValue+=string+" "; } function moveElements(){ moveInfoElement(); } function attachInfoElement( ){ var str='
|
||||||
|
||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||