Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
178
rated 0 times [  184] [ 6]  / answers: 1 / hits: 55677  / 9 Years ago, wed, march 11, 2015, 12:00:00

I created a bootstrap button that has a link inside. Which looks like this:



enter



When you hover on it:



enter



This is the code inside the button:



 <div class=s-8><button type=button onClick=javascript:location.href = 'administration.php';>Administration</button></div>


The logout button:



<div class=s-4><button type=button onClick=javascript:location.href = 'logout.php';>Logout</button></div>


This button works fine on the PC(IE, SAFARI, FireFox, Chrome, Opera) browser(takes me to the administration page, but it doesn't work on the Mobile devices.



I did the same thing for the logout button, and it works fine on PC and Mobile Devices. I am now puzzled.


More From » jquery

 Answers
56

The issue may be that you're using the onClick event which won't register on a mobile device (as you don't click - you tap).



This answer explains how to use the touchstart event which will work on a mobile.



https://stackoverflow.com/a/22015946/2619909


[#67483] Monday, March 9, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
carl

Total Points: 633
Total Questions: 105
Total Answers: 105

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;