当鼠标移到图片上显示大图 网页特效
有办法令鼠标移到图片上显示大图吗?我把图片放在文本筐里,很多小图,我想看见大图之余能有文字说明``但在大图的下面,且可以改变字体,调用原来的css等功能``可以实现吗?在...
有办法令鼠标移到图片上显示大图吗?我把图片放在文本筐里,很多小图,我想看见大图之余能有文字说明``但在大图的下面,且可以改变字体,调用原来的css等功能``可以实现吗?在html上`
展开
1个回答
展开全部
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v;
event.clientY <310 ? obj.pixelTop=document.body.scrollTop+event.clientY :obj.pixelTop=document.body.scrollTop+event.clientY -310;
}
}
//-->
</script>
<div style="position:absolute; visibility: hidden;" id="balloon"> <img src="" width="400" height="300" id="image1" border="1"></div>
<a href=连接地址><img src='http://www.baidu.com/img/logo-yy.gif' width="120" height="90" border=0 title='2007-1-7' onMouseOver="image1.src='http://www.baidu.com/img/logo-yy.gif';MM_showHideLayers('balloon','','show');" onmouseout="MM_showHideLayers('balloon','','hide')"></a>
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v;
event.clientY <310 ? obj.pixelTop=document.body.scrollTop+event.clientY :obj.pixelTop=document.body.scrollTop+event.clientY -310;
}
}
//-->
</script>
<div style="position:absolute; visibility: hidden;" id="balloon"> <img src="" width="400" height="300" id="image1" border="1"></div>
<a href=连接地址><img src='http://www.baidu.com/img/logo-yy.gif' width="120" height="90" border=0 title='2007-1-7' onMouseOver="image1.src='http://www.baidu.com/img/logo-yy.gif';MM_showHideLayers('balloon','','show');" onmouseout="MM_showHideLayers('balloon','','hide')"></a>
参考资料: http://zhidao.baidu.com/question/18003476.html
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询