首页 > 其他 > 详细

JQ 封装一个颜色插件

时间:2018-01-03 21:54:02      阅读:204      评论:0      收藏:0      [点我收藏+]
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>extend</title>
    </head>
    <body>
        <input type="button" value="OK" style="color:red">
        <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <script>
            ;(function($) {
                $.fn.extend({
                    "color":function(value){
                        if( value== undefined){
                            return this.css("color")
                        }else{
                            return this.css("color",value)
                        }
                    }
                })
            })(jQuery)
            var x = $("input").color("pink");
        </script>
    </body>
    </html>

JQ 封装一个颜色插件

原文:https://www.cnblogs.com/ar13/p/8185619.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!