Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Detect mousedown

4 views
Skip to first unread message

Giles

unread,
Sep 19, 2009, 2:47:50 PM9/19/09
to
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?
Thanks


Evertjan.

unread,
Sep 19, 2009, 3:00:07 PM9/19/09
to

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)

Giles

unread,
Oct 7, 2009, 7:41:40 PM10/7/09
to
> 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.
>
> --
> Evertjan.

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


Evertjan.

unread,
Oct 8, 2009, 4:53:26 AM10/8/09
to
Giles wrote on 08 okt 2009 in microsoft.public.scripting.jscript:

>> 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">

0 new messages