jquery 添加方法 : $.fn.方法名 = function(参数a,b,c){

       $.fn.image_checked = function(self,status,img_body,csrf_token){
             $(this).live('click', function(){
        var index = $(this).index()
        var img_id = $('.'+self+' input').eq(index).val();
                $.ajax({
            type:'POST',
                        url:BASEURL+'img/checked_image',
            data:{status:status,img_id:img_id,csrf_token_name:csrf_token},
            success:function(msg)
            {
                $("."+img_body).html(msg);
                $('.mark').imgbig('.mark');
                                tips_load($('.tabs_nav_active').children().children().eq(0).html(),'.cur')
            }
        })

        })
       }


    $.fn.tabs = function(tab_content){
        $(this).each(function(i) {
            $(this).click(function() {
                $(tab_content).addClass('tabs_content_hide').removeClass('cur')
                $(tab_content).eq(i).removeClass('tabs_content_hide').addClass('cur')
                $(this).siblings().removeClass('tabs_nav_active')
                $(this).addClass('tabs_nav_active')
            });
    });

原文地址:https://www.cnblogs.com/legend-song/p/3824441.html