html - IE7 element can't be clicked -


i've narrowed defect down sample, numeral "1" unclickable in ie7 (only):

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head>     <title>click 1</title>     <style type="text/css">              div   { position: absolute; overflow: auto; }         table { position: relative; }         span  { position: fixed; top: 100px; }     </style> </head><body>     <div>         <table>             <tr>                 <span onclick='alert(1)'>1</span>2             </tr>         </table>     </div> </body></html> 

can identify root cause, understand options workarounds?

i'm using css represented here build sortable fixed head scrolling table. in original code, span lives in th, fixing headings above scrolling table via negative margin, while allowing table renderer account header text in column width, without table duplication or 'onresize'-simulating timers.

removing position: relative div fixes it.

if that's not option, found adding *display: inline div fixes it.

the asterisk before display css hack apply rule ie7 , below. it's not awesome 1 use because not valid css, works , causes no problems.

if neither of these ideas works you, helpful see more complete test case understand why.


your original code, <span onclick='alert(1)'> javascript works:
http://jsbin.com/aretu5 (can't click in ie7)

same, position: relative removed:
http://jsbin.com/aretu5/2 (works in ie7)

same, position: relative still there , *display: inline added:
http://jsbin.com/aretu5/3 (works in ie7)


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -