locked
DIV selectable area

    Question

  • It appears that in Windows 8 app the selectable area of a div is only the div's content.  Just for the easiest example, put a style of "cursor:pointer" on a div with a forced width and height, and with content in it.  Something like:

    <div id="mydiv">text</div>

    with a style of

    #mydiv{cursor:pointer;display:block;height:100px;width:100px;border:1px solid red}

    When you run the app, if you hover over any of the empty space in the div, you get no pointer indicator (and, more to the real problem, a click event won't register).  If you hover over "text" inside the div, the pointer indicator comes up and onClick events occur.

    Any thoughts?

    Thanks

    Tuesday, February 19, 2013 12:41 AM

Answers

  • Well, by accident, I found out that if you don't have a position attribute on the DIV, the who area won't be selectable.  Never seen that one before, but apparently necessary for Windows 8 apps.

    Thanks

    • Marked as answer by DaPrezJer Tuesday, February 19, 2013 2:20 AM
    Tuesday, February 19, 2013 2:20 AM