[jQuery] JQuery Plugin: SpinBox / SpinButton Control (with no extra markup)

2006-08-11 Thread George Adamson
Hi everyone, I've been working on a Spin Control that uses only a standard textbox. input type=text / With Javascript enabled the textbox looks and acts like a spin-button control without adding any extra elements. http://www.softwareunity.com/sandbox/jqueryspinbtn/ The up/down arrows are

Re: [jQuery] highlightFade Plugin

2006-09-20 Thread George Adamson
. Many thanks Blair. Regards, George Adamson -- View this message in context: http://www.nabble.com/highlightFade-Plugin-tf2040652.html#a6404220 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http

Re: [jQuery] toggleClass and removeClass

2006-09-21 Thread George Adamson
Hello Mark, Nice to see this bug progressing. A search on keywords http://www.nabble.com/forum/Search.jtp?forum=15494local=yquery=classname+space classname space in the Nabble jquery forum reveals that quite a few of us have reported this in one form or another. Cheers, George Mark D.

[jQuery] fadeIn() changes display to 'block'

2006-09-22 Thread George Adamson
It would seem that the fadeTo() method changes the element.style.display to 'block'. Is this by design? It messes up inline elements. One workaround for the time being might be to wrap an inline element inside another before fading it. Cheers, George DaveG-2 wrote: I was looking at

Re: [jQuery] Help finding parent element

2006-09-24 Thread George Adamson
Good point about using $(../,this) as an alternative to using $(this).parent(), though I've noticed that the syntax should be $(..,this) to return the parent, while $(../,this) returns siblings. Does this sound right? Cheers, George Adamson Glen Lipka wrote: Parent() works, and also xPath

[jQuery] XPath Axes: ancestor(-or-self) / parents / descendent / children

2006-09-25 Thread George Adamson
can't figure out how to enable axis:: selectors. Many thanks, George Adamson -- View this message in context: http://www.nabble.com/XPath-Axes%3A-ancestor%28-or-self%29---parents---descendent---children-tf2331493.html#a6486088 Sent from the JQuery mailing list archive at Nabble.com

Re: [jQuery] Suggestion: add iframe hack to core jQuery

2006-09-26 Thread George Adamson
Nice idea. Quite a few plugins would find that useful. Another useful funtion would be a method to return the x,y (left,top) coordinates of any element (relative to the page or some specified element). The classic iteration through offsetParent elements would be a good start but runs into

Re: [jQuery] Suggestion: add iframe hack to core jQuery

2006-09-26 Thread George Adamson
it to a plugin. http://www.brandonaaron.net/articles/2006/08/10/prototype-extensions-element-getoffset Brandon On 9/26/06, George Adamson [EMAIL PROTECTED] wrote: Nice idea. Quite a few plugins would find that useful. Another useful funtion would be a method to return the x,y (left

[jQuery] New plugin: Extra :selectors such as :focus, :modified, :input, :text

2006-09-27 Thread George Adamson
Simple http://www.softwareunity.com/sandbox/JQueryMoreSelectors/ selectors plugin to add more specific query :selectors to JQuery. Adds things like: - $(FORM/*:modified) - To find form elements that have been changed or selected by the user. - $(FORM/*:focus) - To find the element that has

Re: [jQuery] New Selectors plugin: Adds :focus, :modified, :input, :text etc

2006-09-27 Thread George Adamson
They're in the svn? Great. I'll take them out of my plugin in that case. J?rn Zaefferer wrote: Simple http://www.softwareunity.com/sandbox/JQueryMoreSelectors/ selectors plugin to add more specific query :selectors to JQuery. Actually :input, :text etc. are already in SVN. But

[jQuery] SpinButton Plugin updated

2006-09-27 Thread George Adamson
The SpinButton / SpinBox Plugin has been updated with heaps of improvements by a splendid chap from this forum named Mark Lincoln. The SpinButton Plugin takes ordinary input type='text' boxes and turns them into SpinButton controls using just css and JS/JQuery. No extra markup is added so the

Re: [jQuery] SpinButton Plugin updated

2006-09-27 Thread George Adamson
Good point! (I've now added the link to my previous post for the benefit of nabble users) http://www.softwareunity.com/sandbox/JQuerySpinBtn/ Matt Stith wrote: Ooohhh this could be usefull in an upcoming project, you got a link please? -- View this message in context:

Re: [jQuery] SpinButton Plugin updated

2006-09-28 Thread George Adamson
Great. How is the widget pack going? Are you attempting to unify the various authors' coding techniques or is the priority simply to get them together in one place/plugin? George wycats wrote: It's also a widget that might be featured in the jQuery widget pack I'm putting together. --

Re: [jQuery] SpinButton Plugin updated

2006-09-28 Thread George Adamson
: George Adamson wrote: The SpinButton / SpinBox Plugin has been updated with heaps of improvements by a splendid chap from this forum named Mark Lincoln. It's Mark _Gibson_ :) - Mark - Thanks for the code update. Great stuff. It pretty much worked as-is. All I've added are checks

Re: [jQuery] nth of type not working in some cases

2006-09-29 Thread George Adamson
The :nth-of-type selector is not in the current jQuery Base. Perhaps it was once. As luck would have it I added :nth-of-type to my Selectors Plugin yesterday and I'd love it if you could try it out. JS file: http://www.softwareunity.com/sandbox/JQueryMoreSelectors/JQuery.moreSelectors.js Demo:

Re: [jQuery] this list

2006-09-29 Thread George Adamson
This is probably what you're looking for... http://jquery.com/mailman/listinfo/discuss_jquery.com George volatileservers wrote: Hello list, may I know how can I unsubscribe from the list. Thank you very much for your help volatile ___

Re: [jQuery] slideUp / slideDown and nested divs

2006-09-29 Thread George Adamson
Hi Mike, You just need to tweak the JQuery syntax a little to refer to 'this' instead of e.target: Change from: $(a.folder).toggle(function(e) { $(e.target).parent().next().slideDown('fast'); }, function(e) { $(e.target).parent().next().slideUp('fast'); }); To

Re: [jQuery] Chainable if/else - hot or not?

2006-10-01 Thread George Adamson
Very useful. One thought: It might be nice to allow the elseCallback to run even when ifCallback is not provided. George J?rn Zaefferer wrote: Hi folks, the thread about showing and hiding DDs when clicking DTs gave me an idea for a chainable if/else construct. I have implemented and

[jQuery] How should :nth-of-type work?

2006-10-03 Thread George Adamson
Just canvassing opinions on the :nth-of-type() selector that is in now being tested in the http://www.softwareunity.com/sandbox/JQueryMoreSelectors/ Selectors Plugin (plus other ...-of-type selectors). At face value it would

Re: [jQuery] How should :nth-of-type work?

2006-10-03 Thread George Adamson
Good point J?rn, thank you. (I've not found a good use for :nth-of-type() myself, but someome will!) More interesting as it turns out, is the :nth-sibling-of-type() selector that I created accidentally... It turns out to be a simple way of returning TD elements in the same column of a table.

[jQuery] How can one add httpheaders or cookies to $.ajax() request?

2006-10-05 Thread George Adamson
What is the best way to add a custom httpheader and/or cookie info to a $.ajax() request? Many thanks, George PS: The http://jquery.com/api/ doc for ajax() differs slightly from the $.ajax() functionlality in the current jquery release. -- View this message in context:

Re: [jQuery] Slider plugin (pre-alpha): HELP NEEDED

2006-10-05 Thread George Adamson
Very nice. That'll be useful. I attempted the same thing not long ago but got distracted onto other things. http://www.softwareunity.com/sandbox/JQuerySlider/ (best in IE). Thought it may be helpful to share some discoveries... By using css alone I found there was no need to wrap the slider

Re: [jQuery] Performance question

2006-10-07 Thread George Adamson
Saw you had no responses so here's a couple of suggestions... An easy performance booster is to use the second param in $() to set a context for the search. Eg: $(DIV.myClass, myParentElement). Perhaps this is what you meant when you mentioned 'getting a parent element' ? Chaining methods is

[jQuery] What is the best way to queue several effects?

2006-10-16 Thread George Adamson
Hi there, JQuery does a great job of queuing effects on the same element(s) but I'm not sure how to queue effects on a set of many different ones. What is the best way to run the same fx on many items in sequence, one after the other? Using callbacks is fine for a couple of effects but tedious

Re: [jQuery] What is the best way to queue several effects?

2006-10-17 Thread George Adamson
Thanks nezza, yeah I'm using the handy pause plugin now too, but for each item in the jquery list I'm having to increase the pause param so that the fx run one after the other. This gets the right effect but I'm hoping there is a neater way of queing fx so they run in sequence (and without using

Re: [jQuery] Blurry Text using JQuery... But only in IE - WORKAROUND

2006-10-24 Thread George Adamson
My problem is that the text in the JTicker plugin is coming in blurry. Yeah it is a bug in IE but you can workaround it by explicitly setting the background color of the blurry elements (to any color other than transparent) George -- View this message in context:

Re: [jQuery] New way of animating

2006-11-06 Thread George Adamson
jQuery can do everything that it can, natively (except color animation). Just as an aside, if anyone needs colour animation then http://jquery.offput.ca/highlightFade/ works well for animating color, backgroundcolor or bordercolor. (Though you might not immediately guess from its name) George

[jQuery] What is the best way to show() many items in sequence, one after the other?

2006-11-14 Thread George Adamson
If you have a jquery array of elements and need to call the show(slow) method on each one in turn, how should you do it? For instance how might would you reveal each LI element in a list one after the other? Just applying the show() method reveals them all at once eg: $(#myList LI).show(slow) so

Re: [jQuery] What is the best way to show() many items in sequence, one after the other?

2006-11-14 Thread George Adamson
Thanks Jörn, good idea, that did the trick. With some fiddling I was able to reduce the code to look like this, so it can be applied to any list of elements: var showInSequence = function($el){ if($el $el.is()) $el.eq(0).show(slow, function(){

Re: [jQuery] What is the best way to show() many items in sequence, one after the other?

2006-11-14 Thread George Adamson
Very handy, thanks Choan. By the way the little code rewrite I posted uses .next() because it assumes the elements are siblings (which was ok for my purposes). Jorn's technique, which you also use in your code, does not have this restriction so it is better. George Choan C. Gálvez wrote:

Re: [jQuery] Can someone please explain $() ?

2006-11-14 Thread George Adamson
As you quite rightly say, the $() 'doohickey' returns a jquery object that is a bit like an array of zero or more html elements. Without some help, regular javascript won't know what to do with the doohickey, so if you need the element itself you extract it using the .get(0) method (where 0

[jQuery] Correct way to get the nth item?

2006-11-23 Thread George Adamson
If your jquery results array is in a variable (to reuse it instead of re-querying over and over again) then what is the best way to get the nth item from it *without modifying the array* ? For instance the following would cause the myElements variable to end up containing only one item! var

Re: [jQuery] How to get element when it's ID contains bank space.

2007-01-11 Thread George Adamson
Klaus is absolutely right. If you really really really cannot get around this invalid html then seeking the id as an @attribute seems to work, for example: $([EMAIL PROTECTED]'']) Note: the inner quotes in the example are two single quotes right next to eachother to represent an empty string.

Re: [jQuery] IE 7 fadeIn, fadeOut problem

2007-01-16 Thread George Adamson
Hi Lukas, I've got around problems like this in the past by ensuring you have explicitly specified height and width on the elements before you fade them*. Also, Show() in IE is affected when ClearType is enabled in Windows, but you can get around this by specifying element background color

Re: [jQuery] IE 7 fadeIn, fadeOut problem

2007-01-16 Thread George Adamson
Yep, Ben's right try the plugin. In some cases I found the standard JQuery height() and width() methods adequate, but the dimensions plugin tends to be more reliable. Something like this should do it: (Maybe someone else can offer a shorter technique)

Re: [jQuery] Getting the optgroup for a select option

2007-01-16 Thread George Adamson
I hope I've understood this correctly. Perhaps try something along the lines of this in the function (not tested)... var myOptGrpLabel = $(this).find([EMAIL PROTECTED]).parents(OPTGROUP).attr(label); /* ... do something with myOptGrpLabel... */ The parents(OPTGROUP) could be overkill,

Re: [jQuery] Getting the optgroup for a select option

2007-01-17 Thread George Adamson
of the select list. ~Philip George Adamson wrote: I hope I've understood this correctly. Perhaps try something along the lines of this in the function (not tested)... var myOptGrpLabel = $(this).find([EMAIL PROTECTED]).parents(OPTGROUP).attr(label); /* ... do something

Re: [jQuery] remove in-page links with plain text

2007-01-27 Thread George Adamson
Removing self-links from a page is good plan though it will only work for js-enabled users. Standard readers will still see the full links so this is not a very accessible solution. Best to do it server-side if possible. Anyway, regarding your specific questions: 1) I need a way to not to add

[jQuery] What is the best way to replace an element using JQuery?

2007-01-31 Thread George Adamson
Despite having used JQuery for some time and also written plugins, I've never discovered a good way to replace one element with another. Just need something like: $(#myElement).replaceWith(divnew element/div) Depending on the circumstances I usually find I have to resort to DOM methods or if

Re: [jQuery] What is the best way to replace an element using JQuery?

2007-01-31 Thread George Adamson
method in the core as I've found I need to be able to do this on a regular basis. FWIW, Shane On 1/31/07, George Adamson [EMAIL PROTECTED] wrote: Despite having used JQuery for some time and also written plugins, I've never discovered a good way to replace one element with another

Re: [jQuery] Enabling wildcards in .className selector

2007-02-13 Thread George Adamson
Just discovered that simple wildcards can be used *without* modifying jquery code (phew), by using \\S* in the selector syntax... Can be done like this: $(INPUT.myClass\\S*) will match .myClass1 and .myClassHello etc. This only works where selector searches in the jquery code rely on a regex,

[jQuery] Enabling wildcards in .className selector

2007-02-13 Thread George Adamson
I recently had a need for a simple wildcard in the class selector syntax. eg: $(INPUT.myClass*) would match .myClass1 and .myClassHello etc. As an experiment to make this work I made a small change to JQuery's code but that is decidedly poor practice! I'd like to apply the change as a small

Re: [jQuery] Enabling wildcards in .className selector

2007-02-13 Thread George Adamson
Oh silly me, thanks Klaus, excellent suggestion. That should cover most situations. Much simpler than fiddling with regex, and easier for others to follow! Cheers, George Klaus Hartl wrote: George Adamson schrieb: Just discovered that simple wildcards can be used *without* modifying

[jQuery] How to add event handler to XMLHttpRequest.onreadystatechange?

2007-02-21 Thread George Adamson
Hi folks, Anyone know if it is possible to add a custom event handler for the onreadystatechange events of JQuery AJAX calls? I'm accessing a url that is slow to complete but does add to its output as it progresses. It would be nice to be able to catch each new fragment to inform the user of

Re: [jQuery] How to add event handler to XMLHttpRequest.onreadystatechange?

2007-02-22 Thread George Adamson
object? Or something else? Cheers, George Klaus Hartl wrote: George Adamson schrieb: Hi folks, Anyone know if it is possible to add a custom event handler for the onreadystatechange events of JQuery AJAX calls? I'm accessing a url that is slow to complete but does add to its output

Re: [jQuery] How to add event handler to XMLHttpRequest.onreadystatechange?

2007-02-26 Thread George Adamson
there be any harm in overwriting JQuery's onreadystatechange handler with my own and going from there? Cheers, George Klaus Hartl wrote: George Adamson schrieb: Thanks for the code Klaus. Nice idea... When I tried this, the ajax call worked but the xhr.onreadystatechange is 'undefined

[jQuery] wrapText plugin (to wrap html around text nodes)

2007-03-07 Thread George Adamson
containing just white space. Also ignores text in any child elements. I hope it is useful for some of you! Cheers, George (Tested in IE6, FF2.0.0.1, Opera9.10) // Plugin to wrap html around all non-empty text nodes within an element: (ignores text in child elements) // By George Adamson

Re: [jQuery] Set Id attribute

2007-03-12 Thread George Adamson
Hi Blitze, In your first example you'd need to wrap 'this' like $(this) in order to use the .attr() method. I'm surprised the second example does not work. By the way do you really want all the matched elements to be given the same id? Typically the id of each element should be unique. For a

Re: [jQuery] Find and Remove Elements

2007-03-21 Thread George Adamson
Hi Alex, this is easy with JQuery's filter method because these days it can take a custom function to decide how to filter your elements: Try something like this... (I'd also recommend a simple check to ensure value is numeric before comparing it) // To hide all searchResult DIVs containing

Re: [jQuery] json status returns ajax

2007-03-21 Thread George Adamson
I'd recommend setting up your success handler by using http://docs.jquery.com/Ajax#.24.ajaxSetup.28_settings_.29 $.ajaxSetup() I'm not sure what effect $().ajaxSuccess will have without a selector in the $() to work with. George amircx wrote: why when i get error (status 0) its print out

Re: [jQuery] hoverIntent = my first plug-in

2007-03-22 Thread George Adamson
An excellent idea that works very elegantly. Well done Brian. Might I suggest one more simple config setting... To optionally skip the following check in your handleHover function: if (p == this){return false;} Why? Because I'm using hoverIntent in a hierarchical menu built with *nested*

[jQuery] Why does show(0,callback) not run the callback function?

2007-03-30 Thread George Adamson
Why does show(0,callback) not run the callback function? (Looking in the jQuery 1.1 code I see that is the way it is coded) I ran into this issue because my code chooses an animation speed of zero when the element contains too many items to animate smoothly. I found that the callback only fired