Firefox does not show tooltips on disabled input fields

后端 未结 6 512
余生分开走
余生分开走 2020-12-06 17:22

Firefox doesn\'t display tooltips on disabled fields.

The following displays tooltip in IE/Chrome/Safari except Firefox:



        
6条回答
  •  臣服心动
    2020-12-06 18:12

    The z-indexing thing could be done like this:

      .btnTip
    
      {
    
         position: absolute;
    
         left: 0%;
    
         right: 0%;
    
         z-index: 100;
    
         width: 50px;
    
         /*background-color: red;*/
    
         height: 17px;
    
      }
    

    (…)

    Set width of the tip-span to the same as the button width.
     

    Left and right helps positioning the host on top of the disabled element. The z-index defines what kind of layer you put an element in.

    The higher number of a z-layer the more ‘on top’ it will be.

    The z-index of the host and/or the disabled element should be set dynamically.

    When the disabled element is disabled you want the tooltip host on top and vice versa - at least if you want to be able to click your element (button) when it is NOT disabled.

提交回复
热议问题