小弟用一个浮出层插件写了一个鼠标移动到会员头像上就弹出相关资料等信息,跟微博等一样,但是不知道怎么取值,如下:<script>
$("#trigger5").powerFloat({
    eventType: "hover",
    target: "/member?id=?",  //这里id怎么取到会员的uid呢?求指点
    targetMode: "ajax"
});
</script>页面输出的内容为:<ul><li><a  href="http://localhost/?author=2"><img id="trigger5" src="http://localhost/id=1"/></a></li><li><a  href="http://localhost/wp/?author=1"><img id="trigger5" src="http://localhost/id=2"/></a></li><li><a  href="http://localhost/?author=4"><img id="trigger5" src="http://localhost/id=3"/></a></li></ul>求大牛指点

解决方案 »

  1.   

    var s = 'http://localhost/id=1';  // 获取dom的src
    alert( s.split('=')[1] ) // 赋值给变量
    target: "/member?id="+s.split('=')[1]
      

  2.   

    感谢calmcrime指点,但是这样只能取到一个用户的信息,我改了下如下:<script>
    var uid = $(".test").attr('href');
    $(".trigger5").powerFloat({
        eventType: "hover",
    target: "/member?uid="+uid.split('=')[1], 
        targetMode: "ajax"
    });
    </script>这样任意点到一个用户头像上,显示的都是第一个用户的信息,求大牛指点。
      

  3.   

    $(dom).mouseover(function(){   // 改成你需要的触发事件
    // this.href
    ....
    })
      

  4.   

     <script>
    $("#trigger5").powerFloat({
        eventType: "hover",
        target: "/member?id=" + $(this).attr("src").split("=")[1], 
        targetMode: "ajax"
    });
    </script>
      

  5.   

    感谢jszoulin指点,这样的话提示:$(this).attr("src") is undefined
    [在此错误处中断]  target: "/member?uid="+ $(this).attr('src').split('=')[1],
      

  6.   


    感谢calmcrime大神指点,我研究了下,改了代码如下:
    $(function(){ 
         $(".trigger5").mouseover(function(){ 
    $(this).powerFloat({
    target: "/member?uid=" + $(this).attr('rel'), 
    targetMode: "ajax"
    });
            }); 
     });下载可以正常弹出了,可是每次鼠标移动上去,都会发送5-6个请求,如下:GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
    GET http://localhost/member?uid=2 200 OK
      

  7.   

    试试
    mouseenterhttp://www.w3school.com.cn/jquery/event_mouseenter.asp