ontouchstart and ontouchend in jquery?

后端 未结 4 840
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-15 17:23

I am currently using the following for every element I want to change the class of on touch:

ontouchstart=\"$(this).addClass(\'select\');\" ontouchend=\"$(this).         


        
4条回答
  •  失恋的感觉
    2021-02-15 17:56

    I ended up just using this:

    $('#nav li').bind('touchstart', function(){
        $(this).addClass('select');
    }).bind('touchend', function(){
        $(this).removeClass('select');
    });
    

提交回复
热议问题