Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/11/2004, 10:46
kepawe
 
Fecha de Ingreso: agosto-2004
Mensajes: 157
Antigüedad: 20 años, 6 meses
Puntos: 5
Hola salvica

Prueba a ver con esto cambios, no lo he probado pero creo que debería funcionar.

Añade estas funciones:
Código PHP:

// Devuelve la anchura visible de la pantalla

function get_client_width() {
    if (
window.innerWidth != null)
        return 
window.innerWidth;
    if (
document.body.clientWidth != null)
        return 
document.body.clientWidth;
    return (
null);
}
// Devuelve la altura visible de la pantalla
function get_client_height() {
    if (
window.innerHeight != null)
        return 
window.innerHeight;
    if (
document.body.clientHeight != null)
        return 
document.body.clientHeight;
    return (
null);
}

//Devuelve el desplazamiento del scroll inferior
function get_scroll_client_width(){
  if(
window.pageXOffset != null)
    return 
window.pageXOffset;
  if(
document.body.scrollLeft != null)
    return 
document.body.scrollLeft;
  return (
null)

}
//Devuelve el desplazamiento del scroll izquierdo
function get_scroll_client_height(){
  if(
window.pageYOffset != null)
    return 
window.pageYOffset;
  if(
document.body.scrollTop != null)
    return 
document.body.scrollTop;
  return (
null)


Despues en la función mouseOver() añade esto.
Código PHP:

       
// compruebo el navegador utilizado (no lo pongo porque es muy largo) y visualizo el "tip"
                         //     solo pongo el "document.all"
               
var tooltip
               marginXY 
10
               
if( document.all ) {
               
//  Internet Explorer
                   
tooltip document.all("tip")
               } else if( 
document.layers ) {
                      
//  Nestcape 4.X
                          
tooltip document.layers["tip"]
                      } else if( 
document.getElementById ) {
                             
//  Nestcape 6.X
                                 
tooltip document.getElementById("tip")
                             }
                             
                              
tooltipWtooltip.offsetWidth
                              tooltipH 
tooltip.offsetHeight


                              winW 
=  get_client_width()+ get_scroll_client_width()
                              
winH get_client_height()+ get_scroll_client_height()

                              
cursorY e.pageY e.pageY  e.document.body.scrollTop
                              cursorX 
e.pageX e.pageX e.document.body.scrollLeft

                                
// situamos el tooltip a la derecha
                                
if(tooltipW winW cursorX ) { cursorX += marginXY}
                                
// izquierda
                                
else if(tooltipW cursorX){cursorX -= tooltipW marginXY }
                                
// centro
                                
else {cursorX cursorX - (tooltipW 2)}

                                
//  abajo
                                
if(tooltipH marginXY  winH cursorY ) { }
                                
// arriba
                                
else if(get_scroll_client_height() < cursorY - (tooltipH marginXY)){cursorY -= (tooltipH marginXY )}
                                
// lo centramos en la pantalla
                                
else{cursorY tooltipH marginXY  get_client_height()   ?  get_scroll_client_height() + marginXY cursorY - ((tooltipH marginXY )/ 2)}

                                  
tooltip.style.top cursorY;
                                  
tooltip.style.left cursorX
                                  tooltip
.style.visibility "visible"
                
//aquí acaba la función
                

Por ultimo tienes que añadir un nuevo argumento,

En la etiqueta html

onMouseOver="mouseOver(event, '#FFFFE6', '#000000', 'Galicia - La Coruña' )

y en la funcion

function mouseOver(e, NOMBRE, COLORWEB1,etc...

Espero no haberme equivado es mucho código.
En caso de que te de error puedes ponerlo en una página de prueba, así sería más facil solucionar el error.

Espero que te sirva

Un saludo