-2

I have a website with an image and Href link to it linking to a phone number.

<a href="tel:999999999"> <img class="banner" src="assets/banner.gif"></a>

So, when an user come to my website, he see the image, and after click on it triggers the phone call.

The thing that im trying to achieve is to skip the step of clicking i the image. So, when someone land in my website automatically triggers the phone call. Its like when someone land in my website, automatically clicks on the image.

But i want to do this action, only for mobile users. Can anyone help me with this?

I appreciate it. Thanks

  • 4
    So you want to be able to make a phone call without the user doing anything? Lol. Impossible and for a very good reason. – Reinstate Monica Cellio Mar 22 '18 at 12:04
  • I sincerly hope this isn't a public site ... – Pac0 Mar 22 '18 at 12:05
  • You can `.trigger()` the click or call the method the click event calls on load of the page if site is accessed from mobile devices. – Nope Mar 22 '18 at 12:05
  • Imagine you visiting a page and it triggers a phone call to an unknown number without your permission. – Franjo Pintarić Mar 22 '18 at 12:06
  • no no. When you click on the image, your phone shows a pop-up the the user has to accept to make the phone call. Im no trying to force the website to make phone calls, just avoid one step. – user3548720 Mar 22 '18 at 12:06
  • Try this answer : https://stackoverflow.com/questions/13409089/how-can-i-make-an-a-href-only-active-on-mobile-devices – Anas Mar 22 '18 at 12:07
  • [**HTTP: Most reliable way to determine if device accessing site is mobile**](https://stackoverflow.com/questions/11650870/http-most-reliable-way-to-determine-if-device-accessing-site-is-mobile) – Nope Mar 22 '18 at 12:08
  • Don't try to change default behavior of the most commonly used piece of software on the planet. – Reinstate Monica Cellio Mar 22 '18 at 12:11

1 Answers1

1

Reconsider.

What you're asking for is a horrible user experience. Your user has visited your site to view it, not to call you. If they wanted to call you, they'd have dialed your number. Especially considering the fact you would only want this to happen on mobile devices

They may be visiting your site to find your contact number, but to assume all of your visitors want to call you is abuse of power. In general, automatically taking actions without the user choosing to do so by clicking on something themselves is frowned on.