I want to make a screen with an image and a Download button in the center of it. And I want this screen to look good on both pc and smartphone, but I don't want to use responsive. I want this to be done through a script that detects if the person visiting the web is a smartphone or if it is a PC. And as I always use responsive I don't know how this could be done.
Does anyone have any scripts out there that I can use?
What would interest me the most would be for the visitor to be redirected to one version or another with a small script with very little code. A mobile redirect that takes you where it belongs.
To find out if it's a smartphone with javascript (taken from this answer ):
And to redirect:
Alternatively you can check (instead of looking if it is a mobile) the
width
total of the screen withscreen.width
which it returns the maximum width of the client's screen.I have this script in php I don't know if you can use it or it has to be in javascript. Here's the code just in case:
EDITION
Hope this can help you
What I was actually looking for was something like this: This detects the width of the device that visits it and then redirects the user to one website or another.
To me he...
It has stopped working for me; now i work
And it works perfectly, plus m.domain.com seems to be a subdomain probably created for cell phones with access through httaccess.
On my website I mainly use html and css; php only for hit counters and forms.