I was told that Iphones have no mouse.
Yes you can devise any number of alternatives,
like buttons to click upon.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
I have an existing web site, with some pages and browser-based js
applications that use onmousedown and onmouseup (and mousemove). With the
advent of mobile device browsers, I wish to provide alternatives (e.g.
functions for onclick), albeit less functional, for browsers that do not
support onmousedown and onmouseup.
In theory I can do this by checking which device, browser, & version is
being used, but rather than try to keep up to date with every new product, I
thought it would be more robust to detect if these functions were not
supported, and deliver alternative code accordingly.
These events are ignored by e.g. iphone. I was asking if there was a
programmatic way to find out if a particular device ignored them, so the
alternative could be offered.
Giles
>> Giles wrote on 19 sep 2009 in microsoft.public.scripting.jscript:
>>
>>> Some browsers (eg iPhone Safari) do not detect (or maybe ignore)
>>> events like onmousedown and onmouseup. Is there a way in javascript
>>> to detect whether these events are detected? So an alternative can
>>> be scripted when this happens?
>>
>> I was told that Iphones have no mouse.
>>
>> Yes you can devise any number of alternatives,
>> like buttons to click upon.
>>
> I have an existing web site, with some pages and browser-based js
> applications that use onmousedown and onmouseup (and mousemove). With
> the advent of mobile device browsers, I wish to provide alternatives
> (e.g. functions for onclick), albeit less functional, for browsers
> that do not support onmousedown and onmouseup.
The onclick, [and mousedown/mouseup, I think] will work on most modern
mobile browsers.
The problem is you cannot hover/mouseover and mouseout without a
mouse/touchpad.
> In theory I can do this by checking which device, browser, & version
> is being used, but rather than try to keep up to date with every new
> product, I thought it would be more robust to detect if these
> functions were not supported, and deliver alternative code
> accordingly.
>
> These events are ignored by e.g. iphone. I was asking if there was a
> programmatic way to find out if a particular device ignored them, so
> the alternative could be offered.
Did you try CSS handheld?
<link
rel="stylesheet"
type="text/css"
media="handheld"
href="myHandheld.css">