Simple Little Tricks for Web Transition Touch Events on Mobile Devices

By Zedric Myers | Published May 7, 2015 | Categories: Web Development

If you want to have a web transition hover event to show on your website for mobile devices, you just need to attach this attribute:

“onclick=”void(0);”

There are multiple ways to do it, but this is a simple way.

If you didn’t want to edit single HTML links for the touch events you can use an event listener.

To do that you simply update your body tag in the HTML to this:

“<body ontouchstart=””>”

If you don’t want to edit your HTML or if you have a lot of pages that need that result you can add this script to your javascript file.

“document.body.addEventListener('touchstart',function(){},false);”

It can also be done with simple CSS “:active” tag appended to the specific element in your CSS file, but in some mobile operating versions it may not work.

Source References: Stackoverflow

Contact Us To Find Out More

Have questions? Need help? Contact us and we'll be in touch soon!

* Required

Beacon
164 Thatcher Road
Greensboro, NC 27409
Map and Directions

Sales & Marketing
336.232.5687