Is it possible to check for PNG support with jQuery.Support?

前端 未结 5 1271
抹茶落季
抹茶落季 2021-01-15 04:59

My question is regarding the jQuery Support system.

I\'d like to know if it is possible to tell whether or not the browser will support semi-transparent background P

5条回答
  •  走了就别回头了
    2021-01-15 05:17

    I don't use Js for this sort of thing...

    I use

    .png24 {
      background-image: url(png24.png);
    }
    
    /* ie6 */
    * html .png24 {
     background-image: url(non-png24.png);
    
    }
    

    jQuery have deprecated the browser checking in jQuery 1.3. I'm not sure when they will entirely remove it though.

    I would highly recommend leaving this checking up to CSS and/or conditional stylesheets.

    There is no way to in JS to check for the ability to support alpha transparency without checking browsers.

提交回复
热议问题