In addition to the traditional PIE.htc behavior, the distribution now also includes a pure JavaScript version of the tool, PIE.js. While the .htc behavior is still the recommended approach for most users, the JS version has some advantages that may be a better fit for some users.
Advantages of the JS versionSince it is a normal .js file, PIE.js does not suffer from some of the more annoying limitations of the PIE.htc behavior:
Unfortunately there are some significant drawbacks to using PIE.js, which is why the .htc behavior is still the recommended approach for most users:
If you've decided the above advantages outweigh the disadvantages for you, here's how you go about using PIE.js.
<!--[if IE]>
<script type="text/javascript" src="path/to/PIE.js"></script>
<![endif]-->
Note: The code above is for PIE.js 1.0; if you are using a PIE 2.0 beta build, then you will need to include the appropriate JS file for the current IE version:
<!--[if lt IE 9]>
<script type="text/javascript" src="path/to/PIE_IE678.js"></script>
<![endif]-->
<!--[if IE 9]>
<script type="text/javascript" src="path/to/PIE_IE9.js"></script>
<![endif]-->
PIE.attach(el)
function for each element that needs CSS3 styling. Make sure you do this after the page's DOM has been fully loaded. For example, using jQuery:
$(function() {
if (window.PIE) {
$('.rounded').each(function() {
PIE.attach(this);
});
}
});
If you are going to add new elements to the page via JavaScript after the fact, you will have to make sure your JS code calls PIE.attach(el)
for each new element that needs CSS3 styling. Calling attach for a particular element more than once is safe (PIE will ignore the call if the element has already been attached), so you don't need to worry about filtering out elements.
Also, if you remove elements from the page that had PIE attached, you will need to call PIE.detach(el)
to clean up their CSS3 rendering.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4