var hasTouch=function(){ var touchObj={}; touchObj.isSupportTouch = "ontouchend" in document ? true : false; touchObj.isEvent=touchObj.isSupportTouch?‘touchstart‘:‘click‘; return touchObj.isEvent; }