W3C home > Mailing lists > Public > www-talk@w3.org > November to December 2013

Re: "display:none" on android browser will prevent "click" event?

From: Harold Dennison <harold.dennison@gmail.com>
Date: Wed, 4 Dec 2013 16:15:36 +0100
Message-ID: <CAL6vj4TRjTX1hio4dqCc=hbWHA8-CN=WyDm3GCuaxg1Z5HOggg@mail.gmail.com>
To: chun zhang <mrchunzhang@gmail.com>
Cc: www-talk@w3.org
>
>
>
> *"display:none [...] causes an element to not appear in the formatting
> structure <http://www.w3.org/TR/CSS21/intro.html#formatting-structure>" "**Please
> note that a display of 'none' does not create an invisible box; it creates
> no box at all." *


http://www.w3.org/TR/CSS21/visuren.html#propdef-display

I suppose that's "why"



On Wed, Dec 4, 2013 at 2:26 PM, chun zhang <mrchunzhang@gmail.com> wrote:

> <!DOCTYPE html>
> <html>
> <head>
> <script src="
> http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
> </script>
> <script>
> $(document).ready(function(){
>   $("p").click(function(){
>     $("#test").click();
>   });
> });
> </script>
> </head>
> <body>
> <p>If you click on me, I will disappear.</p>
> <p>Click me away!</p>
> <p>Click me too!</p>
> <input id="test" type="file" style="display:none;">
> </body>
> </html>
>
> Run this code on android browser, click p will never show file dialog.
> But if I remove style="display:none;", let the input show, it works.
> Why?
>
Received on Thursday, 5 December 2013 21:53:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:10 UTC