hello ,my Controllers events does‘t work,i can't find the reason~

15 views
Skip to first unread message

Marisa leer

unread,
Jan 28, 2014, 9:46:02 AM1/28/14
to spi...@googlegroups.com
the code. i don't use CoffeeScript, 

HTML 
 <ul style="line-height: 40px">
        <li class="item">三胖</li>
        <li class="chunying">王春颖</li>
        <li class="zhang">张老师</li>
    </ul>



Spinejs

jQuery(function($){

    var Users = Spine.Controller.sub({
        events: {
            "click .item": "click"
        },

        click: function(event){
            alert(event.target.nodeName)
        },

    });

    var user = new Users({
        el:".item"
    })

});

the image I find the "click" event has bind ,but the function didn't on.

中文
通过chrome的调试,发现.item 绑定了事件,但是点击后并没有运行该函数。
QQ图片20140128223225.jpg
Reply all
Reply to author
Forward
0 new messages