display image ONLY if ipad/ipod/iphone is detected
I have images in my site that display text over them on mouse over.
silly me, well obviously the ipad needs a click!
SO my only thoughts are to make a small info button appear in each of the images,
so they know to click there.
I want them only to appear only on ipad, iphone, ipod, or touch devices in general.
you can do that in a more simple way.
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad'))
also for you may have to add few more user agents to target touch screen devices, as there are millions Android as well
Here is a very useful JS code to detect devices or specific browsers in general:
// do some action, for example:
Note: that above code works with iPad/iPhone/iPod because it detects an "ip" text-value in the navigator-name detection, but you can change the value in order to detect whatever you want.
In the example, if an Apple mobile device is detected, the code redirects to a specific page you may build for mobile devices... but you can do anything you want.
Hope that will help someway ;-)
Last edited by MrSnowDrop; 09-19-2012 at 05:34 AM.