JS脚本修改 鼠标点击显示改为鼠标放上显示
以下是段可用的JS脚本,只要指定6张图片即可.效果:当鼠标点击右侧6张缩略图时,左侧显示出大图.现在想要的效果是,当鼠标放在缩略图上,就显示大图.原脚本如下:<head>...
以下是段可用的JS脚本,只要指定6张图片即可.效果:当鼠标点击右侧6张缩略图时,左侧显示出大图.
现在想要的效果是,当鼠标放在缩略图上,就显示大图.
原脚本如下:
<head>
<script>
function seeBig(thispic) {
if(thispic==1){
document.all.viewPic.innerHTML='<img src="img/1.jpg" >'
}
if(thispic==2){
document.all.viewPic.innerHTML='<img src="img/3.jpg" >'
}
if(thispic==3){
document.all.viewPic.innerHTML='<img src="img/4.jpg">'
}
if(thispic==4){
document.all.viewPic.innerHTML='<img src="img/2.jpg" >'
}
if(thispic==5){
document.all.viewPic.innerHTML='<img src="img/5.jpg" >'
}
if(thispic==6){
document.all.viewPic.innerHTML='<img src="img/6.jpg" >'
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
img {border-color:#C0BEBF}
</style></head>
<body>
<table width="763" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bbj.jpg">
<tr>
<td height="41" align="left" valign="top"><table width="763" border="0" align="center" cellpadding="3" cellspacing="3" >
<tr>
<td width="539" rowspan="3" align="left" valign="top"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="47" align="left" valign="top"><td colspan="6" align="center" id="viewPic" bgcolor="#FFFFFF"><img src="img/1.jpg"></td></td>
</tr>
</table></td>
<td width="10 align="left" valign="top" ><span class="spic" ><a href="javascript:seeBig(1)" style="cursor:pointer"><img src="img/1.jpg" width="100" height="60" border="1"></a></span></td>
<td width="70" align="left" valign="top"><span class="spic"><a href="javascript:seeBig(4)" style="cursor:pointer"><img src="img/2.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(2)" style="cursor:pointer"><img src="img/3.jpg" width="100" height="60" border="1"></a></span></td>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(3)" style="cursor:pointer"><img src="img/4.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(5)" style="cursor:pointer"><img src="img/5.jpg" width="100" height="60" border="1"></a></span></td>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(6)" style="cursor:pointer"><img src="img/6.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
</table></td>
</tr>
</table> 展开
现在想要的效果是,当鼠标放在缩略图上,就显示大图.
原脚本如下:
<head>
<script>
function seeBig(thispic) {
if(thispic==1){
document.all.viewPic.innerHTML='<img src="img/1.jpg" >'
}
if(thispic==2){
document.all.viewPic.innerHTML='<img src="img/3.jpg" >'
}
if(thispic==3){
document.all.viewPic.innerHTML='<img src="img/4.jpg">'
}
if(thispic==4){
document.all.viewPic.innerHTML='<img src="img/2.jpg" >'
}
if(thispic==5){
document.all.viewPic.innerHTML='<img src="img/5.jpg" >'
}
if(thispic==6){
document.all.viewPic.innerHTML='<img src="img/6.jpg" >'
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
img {border-color:#C0BEBF}
</style></head>
<body>
<table width="763" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bbj.jpg">
<tr>
<td height="41" align="left" valign="top"><table width="763" border="0" align="center" cellpadding="3" cellspacing="3" >
<tr>
<td width="539" rowspan="3" align="left" valign="top"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="47" align="left" valign="top"><td colspan="6" align="center" id="viewPic" bgcolor="#FFFFFF"><img src="img/1.jpg"></td></td>
</tr>
</table></td>
<td width="10 align="left" valign="top" ><span class="spic" ><a href="javascript:seeBig(1)" style="cursor:pointer"><img src="img/1.jpg" width="100" height="60" border="1"></a></span></td>
<td width="70" align="left" valign="top"><span class="spic"><a href="javascript:seeBig(4)" style="cursor:pointer"><img src="img/2.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(2)" style="cursor:pointer"><img src="img/3.jpg" width="100" height="60" border="1"></a></span></td>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(3)" style="cursor:pointer"><img src="img/4.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(5)" style="cursor:pointer"><img src="img/5.jpg" width="100" height="60" border="1"></a></span></td>
<td align="left" valign="top"><span class="spic"><a href="javascript:seeBig(6)" style="cursor:pointer"><img src="img/6.jpg" width="100" height="60" border="1"></a></span></td>
</tr>
</table></td>
</tr>
</table> 展开
3个回答
展开全部
<head>
<script>
function seeBig(thispic) {
document.all.viewPic.innerHTML="<img src=\""+thispic+"\" >"
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.img {border-color:#C0BEBF}
.spic{cursor:pointer;}
-->
</style>
</head>
<body>
<table width="763" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bbj.jpg">
<tr>
<td height="41" align="left" valign="top"><table width="763" border="0" align="center" cellpadding="3" cellspacing="3" >
<tr>
<td width="539" rowspan="3" align="left" valign="top"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="47" align="left" valign="top"></td>
<td colspan="6" align="center" id="viewPic" bgcolor="#FFFFFF"> </td>
</tr>
</table></td>
<td width="10" align="left" valign="top" ><span class="spic" ><img src="http://www.2548.com.cn/d/20050216035/1078708481.jpg" onClick="seeBig(this.src)" width="100" height="60" border="1"></span></td>
<td width="70" align="left" valign="top"><span class="spic"><img src="http://www.2548.com.cn/d/20050216035/1078707649.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><img src="img/3.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
<td align="left" valign="top"><span class="spic"><img src="img/4.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><img src="img/5.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
<td align="left" valign="top"><span class="spic"><img src="img/6.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
</table></td>
</tr>
</table>
</body>
<script>
function seeBig(thispic) {
document.all.viewPic.innerHTML="<img src=\""+thispic+"\" >"
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.img {border-color:#C0BEBF}
.spic{cursor:pointer;}
-->
</style>
</head>
<body>
<table width="763" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bbj.jpg">
<tr>
<td height="41" align="left" valign="top"><table width="763" border="0" align="center" cellpadding="3" cellspacing="3" >
<tr>
<td width="539" rowspan="3" align="left" valign="top"><table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="47" align="left" valign="top"></td>
<td colspan="6" align="center" id="viewPic" bgcolor="#FFFFFF"> </td>
</tr>
</table></td>
<td width="10" align="left" valign="top" ><span class="spic" ><img src="http://www.2548.com.cn/d/20050216035/1078708481.jpg" onClick="seeBig(this.src)" width="100" height="60" border="1"></span></td>
<td width="70" align="left" valign="top"><span class="spic"><img src="http://www.2548.com.cn/d/20050216035/1078707649.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><img src="img/3.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
<td align="left" valign="top"><span class="spic"><img src="img/4.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
<tr>
<td align="left" valign="top"><span class="spic"><img src="img/5.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
<td align="left" valign="top"><span class="spic"><img src="img/6.jpg" width="100" height="60" border="1" onClick="seeBig(this.src)"></span></td>
</tr>
</table></td>
</tr>
</table>
</body>
展开全部
鼠标事件改为onmouseover
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<a href="javascript:seeBig(*)"
改成
<a href="javascript:;" onmouseover="seeBig(*)"
改成
<a href="javascript:;" onmouseover="seeBig(*)"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询