鼠标移动到一个位置弹出相应的一张图片

     在web开发中,有时候我们不方便把一张图片展示给用户,或者单单以图片不能标识精确信息时,常常将图片的标识(id)展示出来,而在鼠标移动到标识上时弹出相应的图片,两全其美。下面是我使用过的一种实现方法(使用样式表) :
... ...
< style  type ="text/css" > 
.thumbnail { 
  display: block; 
  margin-bottom: 60px; 


.thumbnail span { 
  position: relative; 
  z-index: 0; 


.thumbnail:hover { 
  background-color: transparent; 
  z-index: 50; 


.thumbnail span { 
    


.thumbnail span img { 
  border-width: 0; 
  padding: 2px; 
  position: absolute; 
  background-color: #FFFFE0; 
  left: -1000px; 
  border: 1px dashed gray; 
  visibility: hidden; 
  color: #000; 
  text-decoration: none; 
  padding: 5px; 


.thumbnail:hover img { 
  visibility: visible; 
  top: -30px; 
  left: 0px; 


p { 
  margin-top: 200px 

</style> 

... ...

     < div  id ="mainCon" > 
       < table > 
         < tr > 
           < td > 
            位置: 
           </td> 
         </tr> 
         < tr > 
           < td > 
             < a  class ="thumbnail"  href ="#" >1111111111111111111111 < span ><img 
                  src="http://221.179.221.223/MmsKooRMS/source/20100722/409/2010072216093985244.gif" /> 
             </span>  </a> 
           </td> 
         </tr> 
         < tr > 
           < td > 
             < a  class ="thumbnail"  href ="#" >2222222222222222222222 < span ><img 
                  src="http://221.179.221.223/MmsKooRMS/source/20100721/1134/2010072111342818377.gif" /> 
             </span>  </a> 
           </td> 
         </tr> 
         < tr > 
           < td > 
             < a  class ="thumbnail"  href ="#" >3333333333333333333333 < span ><img 
                  src="http://221.179.221.223/MmsKooRMS/source/20100428/912/2010042809120058431.gif" /> 
             </span>  </a> 
           </td> 
         </tr> 
       </table> 
     </div> 
  ... ...


     本文转自NightWolves 51CTO博客,原文链接: http://blog.51cto.com/yangfei520/372139 ,如需转载请自行联系原作者


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值