如何实现鼠标移到图片的左半部分显示“上一张”,右半部分显示“下一张”,点击进入下一张或上一张图片

时间:2022-11-28 22:24:06
如何实现鼠标移到图片的左半部分显示“上一张”,右半部分显示“下一张”,点击进入下一张或上一张图片 


类似新浪的图片显示

7 个解决方案

#1



<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; ">

<map name="1">
  <area shape="poly" coords="72,64,126,28,65,3,4,30" href="nongchang.asp?action=xuan&id=1" alt="上一张" onFocus="this.blur()">
</map>

#2


用map你自己找找去吧,上边我也前写的。。

#3


<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; width:100px;height:100px;">

<map name="1">
  <area shape="rect" coords="0,0,50,100" href="nongchang.asp?action=xuan&id=1" alt="left" onFocus="this.blur()">
  <area shape="rect" coords="50,0,100,100" href="nongchang.asp?action=xuan&id=2" alt="right" onFocus="this.blur()">
</map>

#4


可是图片的长度宽度是不定的啊

#5


<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; width:100px;height:100px;">

<map name="1">
  <area shape="rect" coords="0,0,50%,100%" href="nongchang.asp?action=xuan&id=1" alt="left" onclick="this.blur()">
  <area shape="rect" coords="50%,0,100%,100%" href="nongchang.asp?action=xuan&id=2" alt="right" onclick="this.blur()">
</map>

#6


用js吧,还要改变鼠标的样式 呢
判断iE用
offsetX
其它用layerX
position要是relative或者absolute才能取到layerX

#7


从网上找了代码解决了

#1



<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; ">

<map name="1">
  <area shape="poly" coords="72,64,126,28,65,3,4,30" href="nongchang.asp?action=xuan&id=1" alt="上一张" onFocus="this.blur()">
</map>

#2


用map你自己找找去吧,上边我也前写的。。

#3


<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; width:100px;height:100px;">

<map name="1">
  <area shape="rect" coords="0,0,50,100" href="nongchang.asp?action=xuan&id=1" alt="left" onFocus="this.blur()">
  <area shape="rect" coords="50,0,100,100" href="nongchang.asp?action=xuan&id=2" alt="right" onFocus="this.blur()">
</map>

#4


可是图片的长度宽度是不定的啊

#5


<img src="Images/cunbg/2.gif" border="0" usemap="#1" style="CURSOR: hand; width:100px;height:100px;">

<map name="1">
  <area shape="rect" coords="0,0,50%,100%" href="nongchang.asp?action=xuan&id=1" alt="left" onclick="this.blur()">
  <area shape="rect" coords="50%,0,100%,100%" href="nongchang.asp?action=xuan&id=2" alt="right" onclick="this.blur()">
</map>

#6


用js吧,还要改变鼠标的样式 呢
判断iE用
offsetX
其它用layerX
position要是relative或者absolute才能取到layerX

#7


从网上找了代码解决了