// Check for non-word characters
rnonword = /\W/,
+ // Check for digits
+ rdigit = /\d/,
+
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
return obj && typeof obj === "object" && "setInterval" in obj;
},
+ isNaN: function( obj ) {
+ return obj == null || !rdigit.test( obj ) || isNaN( obj );
+ },
+
type: function( obj ) {
return obj == null ?
String( obj ) :
// behavior of getting and setting a style property
cssHooks: {
opacity: {
- get: function( elem ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity", "opacity" );
- return ret === "" ? "1" : ret;
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }
}
}
},
// IE uses filters for opacity
return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
(parseFloat(RegExp.$1) / 100) + "" :
- "1";
+ computed ? "1" : "";
},
set: function( elem, value ) {
style.zoom = 1;
// Set the alpha filter to set the opacity
- var opacity = isNaN(value) ?
+ var opacity = jQuery.isNaN(value) ?
"" :
- "alpha(opacity=" + value * 100 + ")";
-
- var filter = style.filter || elem.currentStyle && elem.currentStyle.filter || "";
+ "alpha(opacity=" + value * 100 + ")",
+ filter = style.filter || "";
style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
(function( jQuery ) {
var windowData = {},
- rbrace = /^(?:\{.*\}|\[.*\])$/,
- rdigit = /\d/;
+ rbrace = /^(?:\{.*\}|\[.*\])$/;
jQuery.extend({
cache: {},
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
- rdigit.test( data ) && !isNaN( data ) ? parseFloat( data ) :
+ !jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
"CSS Auto": function(elem,prop){
jQuery(elem).addClass("auto" + prop)
.text("This is a long string of text.");
- return prop == "opacity" ? 1 : "";
+ return "";
},
"JS Auto": function(elem,prop){
jQuery(elem).css(prop,"")
.text("This is a long string of text.");
- return prop == "opacity" ? 1 : "";
+ return "";
},
"CSS 100": function(elem,prop){
jQuery(elem).addClass("large" + prop);
- return prop == "opacity" ? 1 : "";
+ return "";
},
"JS 100": function(elem,prop){
jQuery(elem).css(prop,prop == "opacity" ? 1 : "100px");
},
"CSS 50": function(elem,prop){
jQuery(elem).addClass("med" + prop);
- return prop == "opacity" ? 0.5 : "";
+ return "";
},
"JS 50": function(elem,prop){
jQuery(elem).css(prop,prop == "opacity" ? 0.50 : "50px");
},
"CSS 0": function(elem,prop){
jQuery(elem).addClass("no" + prop);
- return prop == "opacity" ? 0 : "";
+ return "";
},
"JS 0": function(elem,prop){
jQuery(elem).css(prop,prop == "opacity" ? 0 : "0px");
var cur_o = jQuery.style(this, "opacity");
- if ( cur_o !== "" ) {
- cur_o = jQuery.css(this, "opacity");
- }
-
if ( t_o == "hide" || t_o == "show" )
equals(cur_o, f_o, "Opacity must be reset to " + f_o + ": " + cur_o);