Jquery comme Compass css correction
-
01-10-2019 - |
Question
jQuery a correction d'opacité lorsque vous utilisez la méthode css (lignes 4592-4608 sur jQuery 1.4.2):
// IE uses filters for opacity
if ( !jQuery.support.opacity && name === "opacity" ) {
if ( set ) {
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// Set the alpha filter to set the opacity
var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
}
return style.filter && style.filter.indexOf("opacity=") >= 0 ?
(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
"";
}
J'ai commencé à étendre ce comportement à tourner CSS3 sélecteurs navigateur multi compatible (avec beaucoup de recettes que le cadre Compass met en œuvre ).
Y at-il un projet qui fait déjà?
La solution
Il existe différents projets qui couvrent les différents aspects de CSS3. Autant que je sache il n'y a pas de projet unifié décent.
J'utilise actuellement: http://plugins.jquery.com/project/2d-transform
pour les transformations CSS3. Je ne peux pas se sentir vraiment à l'aise de recommander d'autres projets en ce moment.
Il y a aussi: http://plugins.jquery.com/project/corners
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow