summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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} characters left.",
+ negativeCopy: "You are {n} 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"/>') );