does mousedown /mouseup in jquery work for the ipad?

前端 未结 4 1609
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 16:41

I am using the current code:

$(\'body\').mousedown(function() {
        $(\'div#extras\').fadeTo(\'fast\', 1);
});

$(\'body\').mouseup(function() {
                 


        
4条回答
  •  不思量自难忘°
    2020-12-04 17:27

    I found out how to do this for the ipad for those who are interested:

    Instead of the code I used in my question, you would use:

    $('body').bind( "touchstart", function(e){
            $('div#extras').fadeTo('fast', 1);
    });
    

    &

    $('body').bind( "touchend", function(e){
            $('div#extras').delay(2000).fadeTo(1500, 0);
    });
    

提交回复
热议问题