cloudll Posted January 16, 2016 Share Posted January 16, 2016 Hey guys, I have this variable which i use to detect touchscreens and if i need to use touchstart or click. var whatenemyTouch = isMobile ? 'touchstart' : 'click'; I am trying to use it with this: window.onclick=function(e){ I would like to use it inplace of onclick but I cant get it working, any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
requinix Posted January 16, 2016 Share Posted January 16, 2016 Don't use .onclick to set a function. Are you using a Javascript library? If so, what? If not, any reason why not? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.