[Table]На все страницы, на которые надо установить хинт. Установка очень простая и делается в один шаг. Поставьте этот код в конец BODY:[/Table]
Code
<script type="text/javascript">
(function () {
function addEvent( object, type, handler ) {
if ( !object.events ) object.events = {};
if ( !object.events[type] ) object.events[type] = [];
function handle( e ) {
e = e || window.event;
if ( !e.pageX || !e.pageY ) {
var html = document.documentElement, body = document.body;
e.pageX = event.clientX + (html && html.scrollLeft || body && body.scrollLeft || 0) - (html.clientLeft || 0);
e.pageY = event.clientY + (html && html.scrollTop || body && body.scrollTop || 0) - (html.clientTop || 0);
}
handler.call( object, e );
}
object.events[type].push( [ handler, handle ] );
if ( object.addEventListener ) {
object.addEventListener( type, handle, false );
} else {
object.attachEvent( 'on' + type, handle );
}
}
function removeEvent( object, type, handler ) {
var events = object.events[type];
for ( var i = 0; i < events.length; i++ ) {
if ( handler == events[i][0] || !handler ) {
if ( object.removeEventListener ) {
object.removeEventListener( type, events[i][1], false );
} else {
object.detachEvent( 'on' + type, events[i][1] );
}
}
}
}
var nodes = document.all || document.getElementsByTagName( '*' ),
tooltip = document.createElement( 'DIV' );
tooltip.style.display = 'none';
tooltip.style.position = 'absolute';
tooltip.style.backgroundColor = '#555555';
tooltip.style.color = '#FFFFFF';
tooltip.style.padding = '3px';
document.body.appendChild( tooltip );
for ( var i = 0; i < nodes.length; i++ ) {
if ( nodes[i].title || nodes[i].alt ) {
addEvent(nodes[i], 'mouseover', function ( e ) {
var par = this.title ? 'title' : 'alt',
text = this[par];
this.textcache = [ par, text ];
this[par] = '';
tooltip.style.top = e.pageY + 10;
tooltip.style.left = e.pageX + 10;
tooltip.innerHTML = text;
tooltip.style.display = 'block';
addEvent(document, 'mousemove', document.moveHint = function ( ev ) {
tooltip.style.top = ev.pageY + 10;
tooltip.style.left = ev.pageX + 10;
});
});
addEvent( nodes[i], 'mouseout', function () {
tooltip.style.display = 'none';
this[ this.textcache[0] ] = this.textcache[1];
});
}
}
})();
</script>
[Table]