jq的函数调用!!

来源:互联网 发布:网络三字经全文解释 编辑:程序博客网 时间:2024/05/16 01:49
        $('.to_sign , #backsign').on('click',func);   //-------------这里func,不要加(),,,,,否则点击调用不了,,,而且放$(function(){   })中还会自动调用        function func(){            //点击输入框内容为空;            $('#signname').val("");            $('#signtel').val("");            if(!uid || (uid.length == 0)){                alert("请先登陆!!");                window.location.href = '/index.php/Public/index';                return false;            }            $('.shadow_div').css('display','table');//*****            $('.content1').css('display','block');            $('.content2').css('display','none');            $('.content3').css('display','none');        }
        var show = $('#show').val();           if(show == 'showsign'){            func();                              //这里调用,需要加()        }



原创粉丝点击