I'm on Vista/XP, using SmartSVN for the svn, and Notepad++ as my text
editor. For testing/development I have two template folders (one
strict one transitional) that holds a .htm file with the jQuery
script, a script with an empty ready() call and a css file with a CSS
reset. I just copy it over, r
You won't be able to do that if the iframe's content comes from
another domain. What you can do is overlay a DIV or other element on
top of the iframe with position:absolute and get the click events from
there. Not sure it works in all browsers.
cheers,
- ricardo
On Mar 12, 5:35 pm, ECS wrote:
As the error says, the type property can't be changed. You should be
using the right syntax from the start, $('')
etc.
cheers,
- ricardo
On Mar 12, 1:51 pm, Troop4Christ wrote:
> So today I was creating a checkbox element in jQuery when I noticed
> that I had a typo in my code.. I had declared
Right... but it's still an object, not an array, regardless of it's
mimics. Doesn't seem right.
(btw is right-click/inspect in DOM tab on one of the brackets the only
way to inspect the object?)
thanks,
- ricardo
On Mar 5, 12:40 am, John Resig wrote:
> It's supposed to be - and this was a chan
Mistyped:
eq: function( i ) {
var el = [ this[ i<0 ? i+this.length : i] ];
if (el[0] === undefined) el.length = 0;
return this.pushStack( el, 'eq', i );
};
It doesn't seem possible to pass the undefined object along. Anyone
doing that? $(undefined) and $(null) are also unsupported.
You can use jQuery(context).find(selector, selector, selector, ...)
And how do you differentiate between $4( [context], selector,
selector) and $4(selector, selector, selector)?
cheers,
- ricardo
On Mar 3, 4:14 pm, Daniel Friesen wrote:
> Yes, a branch is the idea. Though a branch normally imp
jQuery([undefined])[0] === jQuery([])[0]
eq() always returns a single element, so you'd only need to allow null/
NaN/""/etc to pass through, I guess:
eq: function( i ) {
var el = [ this[ i<0 ? i+this.length : i] ];
if (el === undefined) el = [];
return this.pushStack( el, 'eq', i )
}
20kb is nothing to transfer over a 3G connection (or even EDGE), which
is kind of standard if you're doing any serious mobile browsing.
cheers,
- ricardo
On Mar 3, 5:44 am, Mike wrote:
> Hi David,
>
> pretty cool port of iUI - the only issue I see with it is the size of
> the jQuery library. Ye
Now this is getting dirty - this should do (split for readability):
eq: function( i ) {
var el = this[ i<0 ? i+this.length : i];
return this.pushStack( el || [], 'eq', i )
}
No loss of performance with this one.
- ricardo
On Mar 2, 6:10 pm, Robert Katić wrote:
> I figured out (unfortu
solutions relevant at this point?
> However, I am sure that John will consider this optimization too if
> needed.
>
> On Mar 1, 8:01 pm, ricardobeat wrote:
>
> > We can preserve the index without resorting to get (and without
> > affecting performance) by u
Robert Katić wrote:
>
> > If this solution seems ok, I would update the
> > tickethttp://dev.jquery.com/ticket/4188.
>
> > On Feb 28, 8:50 pm, ricardobeat wrote:
>
> > > Nice catch, that makes sense. Added it to the test page, it has no
> > > signif
e:
>
> eq: function( i ) {
> if ( i < 0 )
> i += this.length;
> return this.pushStack( this[i], 'eq', i )
>
> }
>
> However this solution would be still faster then the one
> onhttp://dev.jquery.com/ticket/4188, I suppose.
>
> On
I think returning undefined is the intention here, same when you do a
lookup for a property that doesn't exist, returning null is not
equivalent. Referencing undefined properties is not a problem in JS,
this "error" is silly not taking the context in consideration.
- ricardo
On Feb 26, 2:30 pm,
Right, thanks!
Using pushStack seems ok, it's still chainable and keeps the selector
state, while still being at least twice faster.
http://dev.jquery.com/ticket/4262
http://jquery.nodnod.net/cases/177/run
cheers,
- ricardo
On Feb 26, 11:28 am, John Resig wrote:
> Well, first I would argue th
y just a convenience plugin,
> > wrapping Array.sort and performing the DOM rearrangements afterwards.
> > My brief and cursory search of jQuery plugins turned up nothing of the
> > sorts (heh), so I just wrote my own simple plugin.
>
> > --
> > Frode
>
> &g
Just to put my finger on the cake, is there any special reason you're
using a custom plugin instead of the available sort() method?
On Feb 24, 8:27 pm, prefect wrote:
> To the defence of jQuery here, I don't think that would work. As I
> understand, the purpose of aliasing those methods is to ma
Use an array, you can also simplify your function a lot by using
jQuery (although it will certainly add overhead):
var items = [];
$('.-list-tem:contains(Item Name)').each(function(){
items.push(this);
});
On Feb 22, 8:38 am, rhhhmon wrote:
> Hey guys,
>
> So here's my problem. I want to sc
>> On Wed, Dec 3, 2008 at 4:27 PM, Ariel Flesler <[EMAIL PROTECTED]> wrote:
>
> >>> That's what I was sort of suggesting, el.ownerDocument.documentElement,
> >>> that is.
>
> >>> As someone said (don't recall and don't wanna
You could simply stop(true,true) the popup animation whenever you
hover a different element, then reposition it and call fadeIn(). With
your suggested addition there would be a noticeable delay between the
fadeOut at the old position, then the start of fadeIn at the new
position, making your page
Why not simplify?
$.fn.inDOM = function(){
var el=this[0];
if (!el) return false;
var doc = el.ownerDocument.documentElement;
return (doc.contains)
? doc.contains(el)
: !!(doc.compareDocumentPosition(el) & 16);
};
36ms vs 12ms for Diogo's 'inDOM3Optimized', but ke
n.
$.fn.inDOM = function(){
var el = this[0];
while (el.parentNode) el = el.parentNode;
return el == this[0].ownerDocument;
};
- ricardo
On 30 nov, 19:43, "Ariel Flesler" <[EMAIL PROTECTED]> wrote:
> Yeah, parentNode is not good enough.
>
>
>
> On Sun, Nov 30
What would be the expected result for your second example?
On 27 nov, 20:25, Mark Gibson <[EMAIL PROTECTED]> wrote:
> I submitted ticket #3657 for a new method: selfOrParents()
> The ticket has since been closed so I'm posting here.
>
> In the ticket I gave the example of
>
> selfOrParents(':hidd
ancestor-or-self: $(...).parents().andSelf()
descendant-or-self: $(...).find('*').andSelf();
These return the exact same collection as it's XPath counterparts.
I'm not familiar with XPath, I'm intrigued by the uses for 'preceding'
and 'following', do you have an example case? It doesn't make muc
Hi,
It seems the ownerDocument is set for the created element even if it's
not in the DOM, it's the document where jQuery was loaded in. A simple
check for parentNode or offsetParent would do:
$.fn.inDOM = function(){
return !!this.parentNode; //boolean
});
parentNode returns faster for el
It's all kind of already in the core:
rewind: $('...').parent().children(':first')
next()
key:
$.fn.key = function(){
return this.parent().children().index(this);
};
current: $('...').val()
valid : $('...').next().length
previous()
I probably misunderstood you, what's your objective?
- rica
Those bracket and dots selectors are very confusing, why not something
simple like $('div:data(foo)') and $('div:data(foo!=dido)') ?
Meanwhile, you can use a simple plugin (WTFPL licensed):
$.fn.hasData = function(){
var a = arguments;
return this.filter( (a[1])
? function(){ ret
That's exactly what I said the day before, you pratically read my
mind :]
http://ejohn.org/blog/ultra-chaining-with-jquery/#comment-321336
What about making all methods 'wait' by default? That's what most
people expect anyway, people new to jQuery only find out the
animations run "in parallel" wh
This question should be asked at http://groups.google.com/group/jquery-en
I suppose.
I assume you're doing something like:
function(){
//do something
if ( test() ) // do something else
}
Just split it in two, and get the second part to be the ajax callback:
function doSomething(){
//b
28 matches
Mail list logo