Re: [jQuery] highlightFade for same id

2007-03-30 Thread Blair Mitchelmore
Selecting by ID in that syntax only selects the first element. Also, pages should only have one element of the same ID, but if you want to you can search using attribute checks. $("[EMAIL PROTECTED]'show_credit_card']").highlightFade({color:'yellow',speed:1000,iterator:'sinusoidal'}); But i

Re: [jQuery] Any regular expression gurus here?

2007-03-29 Thread Blair Mitchelmore
Also, when perl 6 is released it will have support for a much more powerful system called rules which can handle nested parentheses quite handily. -blair Jake McGraw wrote: > Christof: > > This may be true of traditional regular expressions, which is > something you'll encounter in a college le

Re: [jQuery] bind two events to same function

2007-03-27 Thread Blair Mitchelmore
self = this; > jQuery.each (names.split(/\s*,\s*/),function() { > self._bind(this,action); // self._bind(), not self.bind() > }; > return this; > }; > > On 3/27/07, * Blair Mitchelmore* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: >

Re: [jQuery] bind two events to same function

2007-03-27 Thread Blair Mitchelmore
Or if you wanted to hack jQuery a bit for some syntactic sugar: jQuery.fn._bind = jQuery.fn.bind; jQuery.fn.bind = function(names,action) { var self = this; jQuery.each(names.split(/\s*,\s*/),function() { self.bind(this,action); }; return this; }; That code might not work

Re: [jQuery] NEW Plug-in: cfjs (ColdFusionJavaScript)

2007-03-13 Thread Blair Mitchelmore
'!!' double negates the object thus converting it to a boolean. -blair Daemach wrote: > What does the !! do? > > > Dan G. Switzer, II wrote: >>> Please add: >>> >>> StructKeyExists: function(s,k){ >>> for(var n in s){ >>> if (n == k) return true; >>>

Re: [jQuery] Options for Validation...

2007-03-08 Thread Blair Mitchelmore
You might want to look into Mike Alsup's Taconite plug-in . Seems to be able to do what you want. -blair Rick Faircloth wrote: > > Calling all jQuery/CF’ers… > > I’m not real satisfied with the error message placement > > options in Jorn Zaefferer’s valid

Re: [jQuery] get element inside a div simple question

2007-03-02 Thread Blair Mitchelmore
> Seems to be not in order. Like is usual i need to put the > 2 > 2.1 > 2.2 > > ... > > > > > - Mensaje original > De: Blair Mitchelmore <[EMAIL PROTECTED]> > Para: jQuery Discussion. > Enviado: viernes 2 de marzo de 2007, 20:44:55

Re: [jQuery] get element inside a div simple question

2007-03-02 Thread Blair Mitchelmore
var main_content = $("#main_content"); var toBeTOCced = $("h2,h3,h4,h5", main_content); // there it is -blair sebastianw wurtz wrote: > I want to get all the Heading element up to 5 (ex |h2,h3,h4,h5| ) > inside a div like #main_content > > something like this, but inside the #main_content > |var

Re: [jQuery] How do I check for the existence of an object?

2007-02-23 Thread Blair Mitchelmore
You can do (typeof myObj == 'undefined') and I think you can also do (myObj == undefined) thanks to the completely mind-blowing line of code at the beginning of jQuery window.undefined = window.undefined; -blair Daemach wrote: > I want to create a global object to store some settings in, bu

Re: [jQuery] Gmail-style updates

2007-02-23 Thread Blair Mitchelmore
I think your problem might be that in your autosave plug-in you call fcn directly. Try running fcn.apply(this) instead to manually adjust the scope so 'this' references the DOM element again. -blair Daemach wrote: > Bleh. > > When I pass a function in via the plugin's method with the below code

Re: [jQuery] How do I grab just the selected objects out of the jquery object?

2007-02-23 Thread Blair Mitchelmore
$("p").get() returns a regular array with the jQuery set as its members. -blair Daemach wrote: > I got burned by a debug plugin last night so I'm modifying a great object > dumper to run as a jquery plugin. Dumping the entire jquery object is too > much and not useful for this application - I on

Re: [jQuery] Gmail-style updates

2007-02-23 Thread Blair Mitchelmore
why though :) > > It does make sense that the closure would actually have to be created inside > the event handler but .apply(self) is a new one for me. What exactly is > that doing? > > > Blair Mitchelmore-2 wrote: >> $(document).ready(

Re: [jQuery] Reference to newly inserted item?

2007-02-22 Thread Blair Mitchelmore
$(this).parents("div.sidebarToDo").find("input.editableTDItem"); is probably finding every thing you're added. Are you sure there's only one element in the resultant jQuery object? Either way, if the last input field is the only one your care about at the moment you can modify your search to be

Re: [jQuery] Gmail-style updates

2007-02-22 Thread Blair Mitchelmore
x27;#test').blur(fn).keyup(function() { > var el = this.id; > timer = window.setTimeout(fn,2000); > }).keydown(function() { > if (timer) window.clearTimeout(timer); > }); > }); > >

Re: [jQuery] Gmail-style updates

2007-02-22 Thread Blair Mitchelmore
olor","#ddFFdd"); } }); $(this).css("backgroundColor","#FF"); } $(whatever).blur(fn).keyup(function() { $(this).once(2000,fn); }).keydown(function() { $(this).stop(); }); Let me know if that works. -blair Daemach wr

Re: [jQuery] Gmail-style updates

2007-02-22 Thread Blair Mitchelmore
variables in > addition to the event, such as the id and value of the input element that > this event handler is being registered on - how can I do this with the below > code? > > > > Blair Mitchelmore-2 wrote: >> Well first off, my plugin's code can be found at >&

Re: [jQuery] Gmail-style updates

2007-02-21 Thread Blair Mitchelmore
link to your timer plugin? > > If I'm going to use an external function I will need to pass additional > parameters. How do you force passing the event type along with extra data? > I'm newish to javascript... > > > > Blair Mitchelmore-2 wrote: >> It migh

Re: [jQuery] Gmail-style updates

2007-02-21 Thread Blair Mitchelmore
It might be better if you didn't use an anonymous function so you could reference it multiple times. (I'm going to use a plugin I wrote that jQuerizizes timer events cause it really simplifies the syntax of the solution but something equivalent could be done without it.) Example: var fn = funct

Re: [jQuery] Getting parent nodes

2007-02-20 Thread Blair Mitchelmore
$(this).parent("div"); -blair [EMAIL PROTECTED] wrote: > Hi, > > If I have a "this.id" reference to an element in my DOM, how would i get its > parent node? > > More challenging, how would I get the first DIV node that the element is in? > That is, it may be nested within an arbitrary number

Re: [jQuery] Select "orphan" text.

2007-02-20 Thread Blair Mitchelmore
at gets changed at the core, you're out of luck for those leading and trailing text elements. -blair Abel Tamayo wrote: > Actually when you evaluate a string in the jQuery object, you get an > empty object in return: $("plainText1") becomes the empty object []. > >

Re: [jQuery] Select "orphan" text.

2007-02-20 Thread Blair Mitchelmore
;plain2"] is selected. > > Any idea how I can work around this? > > Abel. > > On 2/20/07, *Blair Mitchelmore* < [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > I'm not sure if this would work at all and I'm not sure of the syntax &

Re: [jQuery] Sortables question

2007-02-20 Thread Blair Mitchelmore
$('ol.steps li').each(function(index) { $(this).append('List item ' + (index + 1) + ''); }); Would convert: Cut a hole in a box Put your junk in that box Make her open the box into: Cut a hole in a boxList item 1 Put your junk in that boxList item 2 Make her open

Re: [jQuery] Select "orphan" text.

2007-02-20 Thread Blair Mitchelmore
I'm not sure if this would work at all and I'm not sure of the syntax for the function usage of filter but I think it'd work like this (theoretically): $(whatevah).filter(function() { return this.nodeType && this.nodeType == 3; // nodeType of 3 is a Text node. }); I have no idea if this wo

Re: [jQuery] Unable to chain Find with multiple classes

2007-02-20 Thread Blair Mitchelmore
I think you're looking for filter not find. Try this: $(function(){ $("[EMAIL PROTECTED]").change(function(){ $(".group").hide().filter("."+$(this).val()).show(); }).val("us").change(); }); -blair Jake McGraw wrote: > Hey all, not sure if this is a bug, but I came across it today

Re: [jQuery] How do I get the XML of an ajax request?

2007-02-18 Thread Blair Mitchelmore
Looks like your request worked and you got XML back. You can try inspecting the XML response to see what was return to extract the data manually or if you could also try wrapping the XML document in a jQuery Object and calling the .html() method to get the value of your xml response without any

Re: [jQuery] Plugin Authoring : How to keep plugin state?

2007-02-18 Thread Blair Mitchelmore
If you only want the last time the function was called: jQuery.debug; // Stores last called date for jQuery.fn.debug jQuery.fn.debug = function() { jQuery.debug = new Date(); return this.each(function() { alert(this); }); }; Other things like recording all previous calls and po

Re: [jQuery] get nth item with jquery still usable - not get()

2007-02-14 Thread Blair Mitchelmore
Use eq(n). It does the same thing as get(n) but doesn't break the jQuery chain. -blair Matthew Delmarter wrote: > Hi all, > > I am trying to get to the nth item in an array of results - while still > being able to use jQuery on the object. > > I am quite familiar with using get(n) - which return

Re: [jQuery] .load() on IE7 returns Cached results

2007-02-06 Thread Blair Mitchelmore
Try adding a random number or a timestamp to the url you request. IE loves to retrieve caches when you don't want it to. -blaie Michael E. Carluen wrote: > Hello folks. I’ve been using load() to return some data. Works fine on > Firefox. However, IE7 seems to load data that’s been cached. The

Re: [jQuery] Embedding jQuery in a Greasemonkey script

2007-01-31 Thread Blair Mitchelmore
I would guess that the best way would be to pack the jQuery source into the greasemonkey xpi and access it using the chrome URI interface somehow. I have very limited experience with firefox extensions but that would seem to be the best way in terms of bandwidth and in terms of usability (you w

Re: [jQuery] Custom borders

2007-01-30 Thread Blair Mitchelmore
Unless someone has custom code that extends the Array objects prototype property. Then those functions will become a part of the iteration. -blair Ⓙⓐⓚⓔ wrote: > it's safe when you know what's in the array, and you are sure it's not > an array-like object > > On 1/30/07, Michael Geary <[EMAIL PRO

Re: [jQuery] jQuery doesn't get along with old Prototype

2007-01-26 Thread Blair Mitchelmore
This topic has been completely exhaustingly beaten to death by every single JavaScript conversation ever. The general consensus is that until customizable iterators in JavaScript 2.0 become widespread, avoid Object.prototype like the plague. All the other alternatives are too heavy to be worth

Re: [jQuery] $(ele).css('height') and $.css(ele, 'height') are different?

2007-01-24 Thread Blair Mitchelmore
Not sure on this but... I believe that's because .css() - in the case of IE - returns the element.currentStyle value which is exactly the same as what the stylesheet says. In other browsers, document.defaultView.getComputedStyle is used which computes the actual pixel value of what it returns

Re: [jQuery] jQuery 1.1, Site, Docs, Surprise

2007-01-14 Thread Blair Mitchelmore
jQuery makes every aspect of JavaScript programming not only easier but fun as well! Thanks all for the tremendous contribution of time and skill to create this inimitable framework. Also, I submitted the story to digg, so let's get it on the front page. http://digg.com/programming/jQuery_1_1_R

Re: [jQuery] .not($(obj))

2006-12-31 Thread Blair Mitchelmore
I'm not sure but I think that .not(obj) is currently implemented to exclude singular DOM elements, meaning arrays of elements and jQuery element sets wouldn't do anything. That could maybe be an API change for jQuery 1.1? -blair Oliver Boermans wrote: > Hi all > > It would be useful to be able

Re: [jQuery] DOM traversing then applying a non JQuery function

2006-12-18 Thread Blair Mitchelmore
That would require a change in the moveCodeToImg function. A naive example would be: function moveCodeToImg(element) { // Catch $().each() calls of the function if (typeof element == 'number') element = this; // do stuff to element } -blair Abel Tamayo wrote: > Wow, thanks everyone

Re: [jQuery] highlightFade's source code missing...

2006-12-15 Thread Blair Mitchelmore
Damn broken symlinks... -blair aedmonds wrote: > Hey everybody, > > It seems that the maintainer at http://jquery.offput.ca/highlightFade/ has > some problems with the site. I can't access any of the code for the > highlightFade plugin. It's not available in the jQuery SVN either. > > Could someo

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
What exactly do you mean when you say the handler doesn't know which argument is passed via trigger versus bind? Can you give me an example of this so I can better understand the problem? -blair Jörn Zaefferer wrote: >> The way I coded the trigger and handle functions in my system it worked >>

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
/ fn1 runs with args [event,arg5,arg6,arg1,arg2] // fn2 runs with args [event,arg5,arg6,arg3,arg4] NB. My system doesn't actually do that... I thought I had rewritten that section but I hadn't. I will later today but for now I'm off to lectures... -blair Blair Mitchelmore wrote

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
Well hello right back Jörn! Jörn Zaefferer wrote: > Hi Blair! > >> Since this has come up again, I thought I'd mention - despite my distate >> for plugin pimping - my own event++ system ( >> http://jquery.offput.ca/event++ ) I wrote which could be used as the new >> system. It can handle additi

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
().click(3,fn1); // fn1 called on the first three clicks $().click(fn2); // fn2 called on every click Using this techniques allows you to have arbitrary additional arguments without having to worry about it accidentally triggering a repeat-limited event. -blair Blair Mitchelmore wrote: > S

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-15 Thread Blair Mitchelmore
Since this has come up again, I thought I'd mention - despite my distate for plugin pimping - my own event++ system ( http://jquery.offput.ca/event++ ) I wrote which could be used as the new system. It can handle additional arguments sent to the event simply by adding arguments to the event bin

Re: [jQuery] Refresh an image with dynamic src URL?

2006-11-13 Thread Blair Mitchelmore
If you want to defeat the cache you could try appending the current time as a query string: img.src = fileName + "?" + (new Date()).getTime(); -blair Matt Grimm wrote: > What would be an ideal way to refresh an image whose src attribute is a > script that dynamically generates the image? Would

Re: [jQuery] new plugin: AnimateClass/animateStyle

2006-11-09 Thread Blair Mitchelmore
Beautiful plug-in Paul! I haven't looked at the code yet, but I'm sure it's spectacular. You've officially put my highlightFade plug-in out of business. ;) -- blair Paul Bakaus wrote: > Hi jQuerians, > > I managed to get the core functionality of my new plugin done today. > Still, cross-browse

Re: [jQuery] New Plugin: ODBCDate functions

2006-11-09 Thread Blair Mitchelmore
The problem is the plugin uses d.getYear() which returns the current year minus 1900. To get the actual year that line should be changed to d.getFullYear(). Quick fix until the plugin gets officially updated. -blair Louise Dade wrote: > Hi, > > [I'm usually a lurker, this is my first response -

Re: [jQuery] Enhanced jQuery Events Module

2006-10-27 Thread Blair Mitchelmore
Ah crud, it's already up. Oh well, it doesn't break any older syntax and this is an enhancement module anyways so what the hell. -- blair Jörn Zaefferer wrote: >> If you're asking about Jörn's oneclick(), click(fn,num) syntax I just >> added it into a non-public version and it works fine. I mod

Re: [jQuery] Enhanced jQuery Events Module

2006-10-27 Thread Blair Mitchelmore
Well the changes were actually pretty simple. The first thing I did was change all of the various .bind() and .click() et. al. functions to pass all their arguments along. So jQuery.fn[o] = function(f){ return f ? this.bind(o, f) : this.trigger(o); }; Becomes jQuery.fn[o] = function(f){

Re: [jQuery] Enhanced jQuery Events Module

2006-10-27 Thread Blair Mitchelmore
If you're asking about Jörn's oneclick(), click(fn,num) syntax I just added it into a non-public version and it works fine. I modified it slightly to be .click(num,fn,...) and .bind(type,num,fn,...) to be easier to detect given the arbitrary additional arguments but the functionality is the sam

Re: [jQuery] Enhanced jQuery Events Module

2006-10-27 Thread Blair Mitchelmore
set when either of them is clicked. Not really practical, just some fun code. -- blair David Duymelinck wrote: > Blair Mitchelmore schreef: >> I was saddened and chagrined to discover that the event system didn't >> have additional arbitrary arguments as I thought it did an

[jQuery] Enhanced jQuery Events Module

2006-10-26 Thread Blair Mitchelmore
I was saddened and chagrined to discover that the event system didn't have additional arbitrary arguments as I thought it did and so I wrote them in. I modified the event system very slightly to allow for both additional arguments and scope modification (two features of the Yahoo Event Utility

[jQuery] jQuery Global Events Slightly Askew

2006-10-26 Thread Blair Mitchelmore
So I noticed something recently when I found out about, and played around with, those zany global event triggers. If you add two different events of the same type to the same element, when you call the global event trigger for that type, each event will get called twice. Example: func1 = functi

Re: [jQuery] jQuery and OOP

2006-10-24 Thread Blair Mitchelmore
A technique you might find slightly less ugly is passing 'this' as an argument when you bind the event. If I recall correctly, jQuery has the ability to pass an arbitrary number of additional arguments as an additional argument array to the event bind function. function Counter() { $('#btnCou

Re: [jQuery] Expressions: Search for children within context

2006-10-22 Thread Blair Mitchelmore
I recall that $(" > dt",context) used to work, though I'm not sure if that was "fixed" -blair Jörn Zaefferer wrote: > Hi jQueryians, > > how do I search for a children within a context? > > In other words, how to translate this: > $(context).children("dt")... > into something like this: > $("/dt

Re: [jQuery] jQuery Kinda Plugin: every

2006-10-20 Thread Blair Mitchelmore
Michael Geary wrote: > > You can simplify that code quite a bit. every() and doin() are nearly > identical, so they can both call a common implementation. Ditto for the two > inner loops in stop(). Great suggestions Mike. I noticed that they were very similar but I was too lazy to combine them bu

Re: [jQuery] jQuery Kinda Plugin: every

2006-10-20 Thread Blair Mitchelmore
window.clearInterval(this); }); }); else if (this.timers[id]) jQuery.each(this.timers[id],function(i) { window.clearInterval(this); }); }); } }); Blair Mitchelmore wrote: > Good sugges

Re: [jQuery] jQuery Kinda Plugin: every

2006-10-20 Thread Blair Mitchelmore
Good suggestions John as always. .in() can't be done because 'in' is a JS keyword and I wouldn't want to have to call it like $()['in']() all the time. So I figured two JS keywords smashed together would work and chose .doin() as the function name; if you have any better ideas (maybe .timeout()

[jQuery] Possible Change to jQuery.map()

2006-10-19 Thread Blair Mitchelmore
OK, so I was trying to do something clever with jQuery.map by using the Function.call technique to iterate in my root Object's this scope, but it kept giving me window. Then I read the source and noticed you're calling the function outright. [other stuff] for ( var i = 0; i < elems.length; i++

Re: [jQuery] jQuery Kinda Plugin: every

2006-10-19 Thread Blair Mitchelmore
: // Display the current time updated every 500 ms $("p.display").every(500,function() { $(this).html(new Date()); }); //... some point later in the code execution $("p.display").each(function() { window.clearInterval(this.$every); this.$every = null; }); -blair Bla

[jQuery] jQuery Kinda Plugin: every

2006-10-18 Thread Blair Mitchelmore
I don't know if this exists already but I needed this and assumed it didn't and wrote it myself. Essentially it lets you do something to an element every given time interval. jQuery.fn.every = function(interval,fn) { return this.each(function() { var self = this; window.setIn

Re: [jQuery] tableSorter question

2006-10-16 Thread Blair Mitchelmore
k/> > > Save it and uncomment this line: > > $(drag).children().removeClass("highlighted"); > > then try to drag a row around and drop it into the table again. Now > try the sorting, and you will see that the class doesn#t update again. > Strange, huh? > &g

Re: [jQuery] tableSorter question

2006-10-13 Thread Blair Mitchelmore
I wrote highlightFade so that it would remove the styles it set after the fact except when necessary to keep them for some reason. Can you set up a simple test case of this error so I can see why it's happening? -blair Paul Bakaus wrote: > forget it, it was not a table sorter bug I had, but thi

Re: [jQuery] Plugins using jQuery instead of $ died with latest

2006-10-12 Thread Blair Mitchelmore
Unfortunately, http://jquery.com/src/latest/ doesn't actually return the lastest jQuery release. It returns svn revision 29 which was before the days of the jQuery object; jQuery 1.0.2 is based on svn revision 413. To download the latest stable version of jQuery go to http://jquery.com/src/jque

Re: [jQuery] Breakable Each

2006-10-12 Thread Blair Mitchelmore
I too prefer returning a variable and false is fine by me. It'll just have to be documented so some programmer out there that returns false for some reason or another doesn't get really confused. An example would be a continue style situation: $("p").each(function() { // skip this iteration

[jQuery] Breakable Each

2006-10-11 Thread Blair Mitchelmore
It seems like it would be really easy to implement a breaking mechanism for jQuery .each() function. We could use the same technique prototype does by creating a unique object and letting users throw that to break. We could create a 'break' property inside jQuery that .each() could catch to bre

Re: [jQuery] Documentation of return objects?

2006-10-11 Thread Blair Mitchelmore
age- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Blair Mitchelmore > Sent: Wednesday, October 11, 2006 1:07 PM > To: jQuery Discussion. > Subject: Re: [jQuery] Documentation of return objects? > > I think what he's talking about is whether or n

Re: [jQuery] Documentation of return objects?

2006-10-11 Thread Blair Mitchelmore
I think what he's talking about is whether or not it returns what was just added to the document or the original element. Another example would be whether or not .clone() return the cloned elements in the jQuery set or the original elements. Those sorts of things aren't listed in the documentat

Re: [jQuery] oninput bug workaround

2006-10-08 Thread Blair Mitchelmore
This wouldn't be ideal, nor do I know if it even works but have you tested: someFunction = function() { /* ... */ }; element.attr('oninput','someFunction()'); -blair Duncan Anker wrote: > I've been trying to use oninput to validate fields in firefox and have > had zero luck with it the

Re: [jQuery] .each backwards ?

2006-10-06 Thread Blair Mitchelmore
I propose hcae: jQuery.fn.hcae = function( fn, args ) { return jQuery.hcae( this, fn, args ); }; jQuery.hcae = function( obj, fn, args ) { if ( obj.length == undefined ) for ( var i in obj ) fn.apply( obj[i], args || [i, obj[i]] ); e

Re: [jQuery] Using $ to insert HTML into the page

2006-10-06 Thread Blair Mitchelmore
I'm pretty sure If I recall correctly, jQuery's element creation technique is to create a temporary div (var div = document.createElement('div')) then add the html you provided to that elements innerHTML value (div.innerHTML = html) and then extracting the div's children (using the appropriate

Re: [jQuery] Highlight fade plugin bug

2006-10-05 Thread Blair Mitchelmore
d.link1').click(function() { $(this).highlightFade('#33') }); $('td.link1').hover(function() { $(this).highlightFade('#F0F0F0') },function() { return true }); -blair Blair Mitchelmore wrote: > OK, in what can officially be called the stupidest mistake ever, my

Re: [jQuery] Highlight fade plugin bug

2006-10-05 Thread Blair Mitchelmore
ote: > Yeah, it works on IE, but i didnt mention the real bug. This purple > color is not defined.. lol > > > 2006/10/5, Blair Mitchelmore <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> >: > > That's pretty weird, the page works in firefox but not I

Re: [jQuery] Highlight fade plugin bug

2006-10-05 Thread Blair Mitchelmore
That's pretty weird, the page works in firefox but not IE. I'll have to investigate in a bit; at the moment I've got a large scale software engineering assignment due... -blair Rafael Santos wrote: > hey, have you faced this bug? > > http://blocparty.com.br/js/teste2.html > > Should that happen

Re: [jQuery] unhover and untoggle

2006-10-04 Thread Blair Mitchelmore
Well, while I might not need untoggle and unhover, I definitely enjoy a challenge! I've been thinking about a reliable way to allow multiple hover/toggles and to be able to remove them independently... I'll let you know if I get anywhere with it... -blair Brandon Aaron wrote: > Nothing? > > Am

Re: [jQuery] String Parsing

2006-10-03 Thread Blair Mitchelmore
To avoid running split twice, you could do it this way (removes IE5 from compatibility however): var file1 = str1.split("\\").pop(); -blair Tombo wrote: > this might not be jquery related, but i noticed there are a lot of savvy > javascript programmers in this mailing list. > > i want to grab j

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

2006-10-03 Thread Blair Mitchelmore
Brian wrote: > Elegant? Perhaps. > > Breaks the Principle of Least Surprise? Absolutely, unfortunately. I don't find it to be surprising at all. If you run filter without specifying what you want to do with the subset it creates via a secondary lambda argument, the stack is modified to allow yo

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

2006-10-03 Thread Blair Mitchelmore
I thought, I'd add on my personal thoughts on this subject. Personally, I find the anonymous function version of filter et. al. to be quite intuitive. You can either modify the stack temporarily and continue the chain until you .end() this modified stack and return to the original, or you can s

Re: [jQuery] A bug and an improvement...

2006-09-29 Thread Blair Mitchelmore
While the solution appears more elegant, the document.onreadystateshange property is not as reliable as it should be (according to dean edwards): http://dean.edwards.name/weblog/2005/09/busted/#comment2529 I say we stick with what we know with confidence works. -blair Adam Schlag wrote: > Firs

Re: [jQuery] Hiding multiple elements, then showing one

2006-09-22 Thread Blair Mitchelmore
.get() breaks the chain returning the actual DOM element. .eq() does something similar without breaking the chain $(settings.slide).hide().eq(i).fadeIn(); should work -blair Brian Litzinger wrote: > I have a little bit of code that I want to hide x amount of divs, then when > they're all hidde

Re: [jQuery] Wildcards

2006-09-19 Thread Blair Mitchelmore
This isn't a fullproof solution (it will also find td elements with the id 'comments_td_' if you have one) but I'm not sure that jQuery has wildcard searches (unless the expression parser detects regex and passes it through as the test against the tag/attribute) so you could use $("[EMAIL PR

Re: [jQuery] Sending array vs object

2006-09-14 Thread Blair Mitchelmore
If I'm not mistaken, anything can be used as a key if enclosed in quoted: f = {"float":"right"} // no problem Rather than with implicit quotes: f = {float:"left"} // not so good They can then be accessed via the array accessor f['float']; // no problem But you'll get trouble if you try

Re: [jQuery] Cookie handling in JQuery

2006-09-13 Thread Blair Mitchelmore
I think it would be best if we kept this in the typically succinct syntax of jQuery. such as .html() setting and getting depending on the attributes. This is a simple version that just consolidates your functions but... $.cookie = function(name, value, expires, path, domain, secure) { if (t

Re: [jQuery] swapClass

2006-09-08 Thread Blair Mitchelmore
Wouldn't your code be faster if you did it without generating a new jQuery Object for each element you're doing this for. Also, you could just use the internal jQuery.className.has(el,className) rather than .is('.'+className) since .is() still needs to regex parse your input string to determine

Re: [jQuery] Method Clarification

2006-09-07 Thread Blair Mitchelmore
Sam wrote: > I'm confused about whether .addClass operates on a jQuery object as > documented in jQuery.com/api/, and is listed as "Traversing" in the > cheat sheet. Seems to me .addClass operates on the DOM, and is a > "Manipulation" method? Technically it's listed as jQuery addClass( Strin