[jQuery] Re: New plugin: simple character counter for textareas

2007-05-10 Thread Peng
If I paste text with short menu by Right-Click it isn't working. Which event bound can perfect the function? There seems not acceptable event in jQuery. thomasdeater wrote: I've just released the first version of a simple plugin to add character counters/limiters to textarea elements.

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-10 Thread thomasdeater
On May 10, 6:37 am, Peng [EMAIL PROTECTED] wrote: If I paste text with short menu by Right-Click it isn't working. Which event bound can perfect the function? There seems not acceptable event in jQuery. I've added the onblur event handler. This somewhat alleviates the problem of a

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-10 Thread Ⓙⓐⓚⓔ
since your code is quick, you can also bind mouseup and paste events. paste only works on ie, but if you don't catch up 'til blur time, I guess it's no big deal! On 5/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 10, 6:37 am, Peng [EMAIL PROTECTED] wrote: If I paste text with

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-10 Thread Bil Corry
[EMAIL PROTECTED] wrote on 5/10/2007 10:30 AM: On May 10, 6:37 am, Peng [EMAIL PROTECTED] wrote: If I paste text with short menu by Right-Click it isn't working. Which event bound can perfect the function? There seems not acceptable event in jQuery. I've added the onblur event handler.

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-10 Thread Ⓙⓐⓚⓔ
paste is a weird one! you get the paste contents in the event somewhere and yes, it's fired before the pasting is done! On 5/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 10, 1:45 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: since your code is quick, you can also bind mouseup and paste

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-09 Thread thomasdeater
On May 8, 9:58 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: hmm, what do you get for $('body') or $('html') ?? $('html').parent() = [ Document ] $('body').parent() = [ html ] Nothing unusual here. For now, I've opted for the following: var container = $(settings.container); if

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-09 Thread Ⓙⓐⓚⓔ
sorry, I meant $('html').parent().parent().size() and $('body').parent().parent().size() I'd guess body is 0 and html would croak... On 5/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 8, 9:58 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: hmm, what do you get for $('body') or $('html') ??

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-09 Thread thomasdeater
On May 9, 1:29 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: sorry, I meant $('html').parent().parent().size() and $('body').parent().parent().size() I'd guess body is 0 and html would croak... $('html').parent().parent().size() = 0 $('body').parent().parent().size() = 1 ([Document]) I'll just hope

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread Rey Bango
Very cool. Works great in FF 2 and IE7 [EMAIL PROTECTED] wrote: I've just released the first version of a simple plugin to add character counters/limiters to textarea elements. The demo and code can be found here: http://www.tomdeater.com/jquery/character_counter/ -- BrightLight

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread Chris W. Parker
On Tuesday, May 08, 2007 8:48 AM [EMAIL PROTECTED] said: I've just released the first version of a simple plugin to add character counters/limiters to textarea elements. The demo and code can be found here: http://www.tomdeater.com/jquery/character_counter/ Great! Comment: I think you

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread joomlafreak
sweet little gadget! Joomlafreak On May 8, 1:00 pm, Chris W. Parker [EMAIL PROTECTED] wrote: On Tuesday, May 08, 2007 8:48 AM [EMAIL PROTECTED] said: I've just released the first version of a simple plugin to add character counters/limiters to textarea elements. The demo and code can

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread thomasdeater
Per Chris's suggestion, I've made an update to the plugin. Now, you can specify that the container be an existing DOM element (e.g, #myContainer) or an element type that will be created and inserted in the DOM directly after the textarea (e.g., em). If nothing is specified, a span element will be

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread Jonathan Sharp
On 5/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Per Chris's suggestion, I've made an update to the plugin. Now, you can specify that the container be an existing DOM element (e.g, #myContainer) or an element type that will be created and inserted in the DOM directly after the textarea

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread thomasdeater
On May 8, 3:15 pm, Jonathan Sharp [EMAIL PROTECTED] wrote: On 5/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've got a slightly ugly bit of code where I check to see if the user has specified an existing element by ID for the container. I'd appreciate suggestions for cleaning this

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread Ⓙⓐⓚⓔ
I remember reading the jQuery source, it's held in a div until it is put somewhere! On 5/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Strangely enough, $(em).parent().size() returns 1 when I wouldn't expect it to. For some reason, $(em).parent() returns [div]. I can't figure out why this

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread thomasdeater
On May 8, 4:11 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: I remember reading the jQuery source, it's held in a div until it is put somewhere! I wonder if $(elem).parent().parent().size() == 0 is the best/only option then for determining whether $(elem) is a node in the HTML document. Any other

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread fufay
[EMAIL PROTECTED] 写道: I've just released the first version of a simple plugin to add character counters/limiters to textarea elements. The demo and code can be found here: http://www.tomdeater.com/jquery/character_counter/ cool,it's perfect!

[jQuery] Re: New plugin: simple character counter for textareas

2007-05-08 Thread Ⓙⓐⓚⓔ
hmm, what do you get for $('body') or $('html') ?? On 5/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On May 8, 4:11 pm, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: I remember reading the jQuery source, it's held in a div until it is put somewhere! I wonder if $(elem).parent().parent().size() == 0