夺命雷公狗jquery---22-bind为jquery对象绑定多个相关事件

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="js/jquery.js"></script>
        <script>
            //页面载入ready方法
            $(function(){
                $('img').bind({
                    mouseover:function(){
                        $('#result').html('GOGOGOG');
                    },
                    mouseout:function(){
                        $('#result').html('OUTOUT');
                    }
                });
            });
        </script>
    </head>
    <body>
        <input type="button" id="btnok" value="OK" />
        <hr />
        <img src="images/1.jpg">
        <hr />
        <div id="result"></div>
    </body>
</html>

 

该方法要求参数是一个json对象

posted @ 2015-10-26 17:53  夺命雷公狗  阅读(197)  评论(0)    收藏  举报