summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrandonaaron <brandon.aaron@gmail.com>2009-02-16 09:33:07 -0600
committerbrandonaaron <brandon.aaron@gmail.com>2009-02-16 09:33:07 -0600
commit9770514e20d35a9c4597356bdcc519eb01bd0cb0 (patch)
tree7e2d67068bd99c920ed1ce1c46ef0de0a3c26089
parent9fc7eedbb6baf31e3f43031cde2a4d5f1e0767df (diff)
downloadjquery-countable-9770514e20d35a9c4597356bdcc519eb01bd0cb0.zip
jquery-countable-9770514e20d35a9c4597356bdcc519eb01bd0cb0.tar.gz
jquery-countable-9770514e20d35a9c4597356bdcc519eb01bd0cb0.tar.bz2
avoid setting opacity for IE to avoid clear text issues and fix missing space in IE
-rw-r--r--jquery.countable.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/jquery.countable.js b/jquery.countable.js
index 4ce47ac..fb0b569 100644
--- a/jquery.countable.js
+++ b/jquery.countable.js
@@ -18,15 +18,15 @@ $.fn.extend({
className: 'counter',
tagName: 'span',
interval: 750,
- positiveCopy: "You have {n} characters left.",
- negativeCopy: "You are {n} characters over.",
+ positiveCopy: "You have {n}&nbsp;characters left.",
+ negativeCopy: "You are {n}&nbsp;characters over.",
fadeDuration: 'normal'
}, options);
$el = $('<'+options.tagName+'/>')
.html( options.positiveCopy.replace("{n}", '<span class="num"/>') )
- .addClass( options.className )
- .css({ opacity: 0 });
+ .addClass( options.className );
+ if ( $.support.opacity ) $el.css({ opacity: 0 }); // don't set opacity for IE to avoid clear text issues.
$el[options.appendMethod]($this);
$this
@@ -46,7 +46,9 @@ $.fn.extend({
if ( $el.is(':visible') && percentage_complete < options.threshold )
$el.hide();
- $el.stop().fadeTo( options.fadeDuration, percentage_complete >= options.threshold ? opacity : 0 );
+ if ( $.support.opacity ) // don't set opacity for IE to avoid clear text issues.
+ $el.stop().fadeTo( options.fadeDuration, percentage_complete >= options.threshold ? opacity : 0 );
+
if ( char_diff >= 0 ) {
if ( $el.is( '.'+options.maxClassName ) )
$el.html( options.positiveCopy.replace("{n}", '<span class="num"/>') );