IE8 Standards mode: onclick handler on div does not fire

后端 未结 2 819
面向向阳花
面向向阳花 2021-01-16 10:39

In my application I have a row of buttons (for BBcode) that is included in various places. Each button is an empty div with fixed dimensions, a background image and an oncli

相关标签:
2条回答
  • 2021-01-16 11:26

    I've found the solution. It was the "float:left" attribute on the buttons that made it fail.

    Which is rather strange because in all the other places where this code was included, it also had the float - and it worked. Even in IE8.

    Anyway, removing it and using "display:inline-block" for the placement did the trick.

    0 讨论(0)
  • 2021-01-16 11:38

    I had the same problem in IE8. The transparent areas in the DIVs were not clickable. An easy solution is to set the background-image to a transparent .gif.

    My solution in CSS:

    background-image: url("images/pixel.gif"); 
    

    ...where pixel.gif is a 1x1 transparent image.

    0 讨论(0)
提交回复
热议问题