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

前端 未结 5 1274
抹茶落季
抹茶落季 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:26

    I think I understand what you're after TM, since I'm trying to do something similar: If alpha PNG is supported, insert a PNG using jQuery. Otherwise, do nothing.

    The only solution I can think of is inserting a DIV using jQuery. Then, in the CSS you set the DIV's background-iamge to the PNG you want to use followed by a conditional comment to feed IE6 a transparent gif instead.

    I haven't tried it out yet but it should do the trick.

提交回复
热议问题