谁能给个JS仿人人网里图片上一张下一张链接效果的代码?

RT~~就是鼠标移动上去会有上一张或者下一张提示的效果,好像QQ空间也有这个效果,求完整JS代码!

  • 给你个用JQUERY实现的代码吧

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title> 无标题页</title>
    <script. src="jquery-1.3.2.js" type="text/javascript"></script>
    <style. type="text/css">
    .rootclass{ border:none;position:relative;}
    </style>
    <script. type="text/javascript">
    $(document).ready(function() {
    $(".rootclass").mousemove(function(e){
    var positionX=e.originalEvent.x||e.originalEvent.layerX||0;
    if(positionX<=$(this).width()/2){
    this.style.cursor='url("pre.cur"),auto';
    $(this).attr('title',' 点击查看上一张');
    $(this).parent().attr('href',$(this).attr('left'));
    }else{
    this.style.cursor='url("next.cur"),auto';
    $(this).attr('title',' 点击查看下一张');
    $(this).parent().attr('href',$(this).attr('right'));
    }
    });
    });
    </script>
    </head>
    <body>
    <a href="#" >
    <img src="11.bmp" alt="" class="rootclass" left="http://www.google.cn" right="http://www.baidu.cn" />
    </a>
    </body>
    </html>