Today, feixian started early. We collected plug-ins to share with you-dd_belatedpng plug-ins, which can make the image transparent. This solution only requires one reason, that is, it supports backgrond-position and background-repeat. this is not available for other JS plug-ins. dd_belatedpng also supports the: hover attribute and .
Principle
This JS plug-in uses Microsoft's VML language for rendering, while most other JS plug-ins that solve PNG problems use the alphaimageloader filter.
Usage
1. Download The dd_belatedpng.js file here.
Http://dillerdesign.com/experiment/DD_belatedPNG/#download (with full and compressed versions)
2. Use the downloaded JS call
<SCRIPT type = "text/JavaScript" src = "downloaded JS path"> </SCRIPT>
And then reference it on the PNG page. Code , Because it is for IE6 processing, so add IE6 conditional annotations on the periphery, in order to distinguish it from other browsers. The complete code is as follows:
<! -[If gte ie 6]>
<SCRIPT type = "text/JavaScript" src = "downloaded JS path"> </SCRIPT>
<SCRIPT type = "text/JavaScript"> dd_belatedpng.fix ('css selector, application type'); </SCRIPT>
<! [Endif]->
The reference function is dd_belatedpng.fix (). Fill in the CSS selector that applies PNG (ID selector and class selector can be used) and application type (IMG and background) in brackets ).
Such as dd_belatedpng.fix ('# Box-one, IMG') or dd_belatedpng.fix ('. header, background.
These can be abbreviated as dd_belatedpng.fix ('# Box-one,. header, IMG, background ');.
For more selectors, such as dd_belatedpng.fix ('# Box-one,. header, # footer,. Box-two A: hover, IMG, background'); and so on.
TIPS: note that the punctuation of the selector must be in English; otherwise, it will be ineffective!
Jquery http://www.jqueryba.com/165.html