要完成此效果把如下代碼加入到區(qū)域中
<script>
var isNS4=(document.layers) ? 1 : 0;
var isIE4=(document.all)? 1 : 0;
var isMoz=((document.getElementById) && !(isIE4)) ? 1 :0;
function ShowNavigateur()
{
alert(isNS4);
alert(isIE4);
alert(isMoz);
}
function activate_mousemove(function_mouse)
{
if(isNS4||isMoz)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = function_mouse;
}
function get_mouse(e)
{
var mouse=new Array();
mouse.x=0; mouse.y=0;
if(isNS4||isMoz){
mouse.x=e.pageX; mouse.y=e.pageY;
}else if(isIE4){
mouse.x=event.x+document.body.scrollLeft; mouse.y=event.y+document.body.scrollTop;
}
return mouse;
}
function get_layer(name)
{
if(isNS4){
layer=findLayer(name, document);
//if(layer==null)
//alert('Pb de layer');
return layer;
} else if (isIE4){
//window.status=document.all[name];
return document.all[name];
} else if (isMoz) {
return document.getElementById(name);
}
//alert('Pb de noms');
return null;
}
function findLayer(name, doc) {
var i, layer;
//alert(doc.layers.length);
for (i = 0; i < doc.layers.length; i++) {
layer = doc.layers[i];
//alert(layer.name);
if (layer.name == name)
return layer;
if (layer.document.layers.length > 0)
if ((layer = findLayer(name, layer.document)) != null)
return layer;
}
return null;
}
function hide_layer(layer)
{
if(layer==null){
//window.status="Pas de layer ?cacher";
return;
}
if (isNS4){
layer.visibility = "hide";
}
if (isIE4||isMoz){
layer.style.visibility = "hidden";
}
}
function show_layer(layer) {
if(isNS4){
layer.visibility = "show";
}
if(isIE4||isMoz){
layer.style.visibility = "visible";
}
}
function move_layer_to(layer, x, y)
{
//window.status=layer;
if (isNS4)
{
layer.moveTo(x, y);
}
if (isIE4||isMoz){
//window.status=layer.style;
layer.style.left = x;
layer.style.top = y;
}
}
function setzIndex(layer, z) {
if(isNS4)
layer.zIndex = z;
if(isIE4||isMoz)
layer.style.zIndex = z;
}
function modify_content_layer(layer,content)
{
if(isNS4){
layer.document.write(content);
layer.document.close();
} else if(isIE4||isMoz){
layer.innerHTML=content;
}
}
</script>
<script language="Javascript">
</script>
鼠標(biāo)移過來看看