【Jquery】スマホのhoverをタップで動作

単純にcssのhoverは効かないためタップの動作つけたい場合
引用元見つかったら修正するざんす。

var linkTouchStart = function(){
    thisAnchor = $(this);
    touchPos = thisAnchor.offset().top;
    moveCheck = function(){
        nowPos = thisAnchor.offset().top;
        if(touchPos == nowPos){
            thisAnchor.addClass("hover");
        }
    }
    setTimeout(moveCheck,100);
}
var linkTouchEnd = function(){
    thisAnchor = $(this);
    hoverRemove = function(){
        thisAnchor.removeClass("hover");
    }
    setTimeout(hoverRemove,500);
}
 
$(document).on('touchstart mousedown','.class',linkTouchStart);
$(document).on('touchend mouseup','.class',linkTouchEnd);