[jquery-dev] Re: CONTEXT LOGIC

2009-03-30 Thread DBJDBJ
@Thanks Ricardo, this is actually very on the topic ;o) I do not understand what is beiong argued here? If anything ? My assertions are certainly not "horrible lies"? I knew this speed difference , (and Daniel should know by now ...) We just need jQ "next" to sort out the lack of explanation in

[jquery-dev] Re: CONTEXT LOGIC

2009-03-30 Thread Daniel Friesen
The fact that $('#foo').find('.someclass'); is faster than $('#foo .someclass'); right now is completely irrelevant to reasonable arguments. While it may be faster now, it is highly likely that future work to the selector engine will soon reverse that statement and make the former faster than t

[jquery-dev] Inserting content with each?

2009-03-30 Thread smurkas
Hello. I have a situation where I have grabbed a couple of images off a page and want to insert them again into an unordered list. Grabbing the images was no problem but I don't know what to write when inserting them again. The code below does not result in the images being inserted again, instea

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread Gilles
Might want to try something like this instead: $(".gallery img").each(function() { $('#bild_spel div ul').append(''); }); haven't tested it but I believe it's correct :) On Mar 30, 11:48 am, smurkas wrote: > Hello. > > I have a situation where I have grabbed a couple of images off a page

[jquery-dev] Re: jquery 1.3.2 remove() kills events?

2009-03-30 Thread Gilles
I don't think this is a bug, if you go ahead and remove an element it is quite normal to assume that you would want the binding on that element to be removed as well in order to save ressources. In most cases a removed element is not going to come back, otherwise it's easier to just move it out of

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread Gilles
For some reason your answer doesn't show on here. You might have mail me directly, anyway if you want to insert the element straight away instead of creating a new image element maybe the fact that you are mixing string variable and an object in your appen() might cause the problem. In your code

[jquery-dev] jquery 1.3.2 remove() kills events?

2009-03-30 Thread niraj
Hi All, I am using remove() to remove html from a li. I have a hover and click event attached to the li. This is a circular carousel and i want to remove the li which goes out of the visible area. For this, i get the non-visible li, get its html, add it to the back of the list and remove this li.

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread smurkas
Thanks for the tip, that works :D. However it seems rather roundabout to create new img-elements when the elements i grab are img-elements. I have continued to experiment and this works too: var img = $(".gallery img"); $(".gallery").remove(); $(img).each(function() { $("#bild_spel div ul

[jquery-dev] Re: jquery 1.3.2 remove() kills events?

2009-03-30 Thread Már Örlygsson
> I believe this is a bug. Is there a workaround/fix tet? It's intended as a feature. Most jQuery newcomers must find out the hard way that .remove() is really more like a "destroy" or "delete" method. If you .remove() an element you're signalling that you don't intend to use it again. Fortunate

[jquery-dev] [Bug] Sibling selector in 1.3.2

2009-03-30 Thread yodza
Hi, >From 1.3.1 to 1.3.2 sibling selector does not work anymore: http://jquery.nodnod.net/cases/277 $(document).ready(function() { module("Sibling in jquery-1.3.2"); test("Sibling filter", function() { var length = jQuery("li.selected").siblings("li").length; equals(length, 2, "sibling fi

[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-30 Thread Gilles
Looking at the 1.4 roadmap and xLazyLoader seems like I can stop looking into the problems stated above by either waiting for 1.4 or integrating xLazyLoader into my plugin as it seems to do exactly what is causing me problems. On Mar 29, 12:12 pm, Gilles wrote: > I have tried the new Function ap

[jquery-dev] Re: [Bug] Sibling selector in 1.3.2

2009-03-30 Thread Fabio Buffoni
Hi John, I think this is a problem with the sibling optimization I made. It fails when the searched element is in the checkSet. In dirNode and dirNodeCheck the following if: if ( sibDir && elem.nodeType === 1 ) { elem.sizcache = doneName;

[jquery-dev] Re: [Bug] Sibling selector in 1.3.2

2009-03-30 Thread John Resig
Actually, I think this one was already fixed. Can you test it real quick? http://code.jquery.com/nightlies/jquery-2009-03-26.js --John On Mon, Mar 30, 2009 at 8:24 AM, yodza wrote: > > Hi, > > From 1.3.1 to 1.3.2 sibling selector does not work anymore: > http://jquery.nodnod.net/cases/277 >

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread Daniel Friesen
var img = $(".gallery img"); $(img).each(function() { $("#bild_spel div ul").append( $('').append(this) ); }); ~Daniel Friesen (Dantman, Nadir-Seen-Fire) Gilles wrote: > For some reason your answer doesn't show on here. You might have mail > me directly, anyway if you want to insert the e

[jquery-dev] Image Crop Question overlay dimensions

2009-03-30 Thread Joshua
Okay... I have a predetermined photo position and size/width on my layout and I want when they click the photo for it to overlay or blockout all areas but the revealed photo spot. Once that occurs, they can plug a photo onto the page and drag it around behind the overlay so that all is exposed is

[jquery-dev] Re: [Bug] Sibling selector in 1.3.2

2009-03-30 Thread yodza
Thanks Fabio ! It works back after removing those lines from: http://code.jquery.com/nightlies/jquery-2009-03-26.js *** jquery-2009-03-26.js.orig 2009-03-30 19:43:31.0 +0200 --- jquery-2009-03-26.js2009-03-30 19:45:50.0 +0200 *** *** 1459,1468 f

[jquery-dev] Centering on the viewport

2009-03-30 Thread Julian Aubourg
Hi all, I'm in the process of migrating a site from 1.2.7 to 1.3.2. So far, I just ran into a bug in webkit browsers that forced me to rewrite "expr1, expr2, ... exprN" selectors into loops (I suppose you're aware of this one). I also have trouble with attaching event handlers to dynamically creat

[jquery-dev] Re: jquery 1.3.2 remove() kills events?

2009-03-30 Thread Pat Nakajima
This sounds like a good candidate for event delegation. I believe that jQuery.fn.live implements this for bubbling DOM events: http://docs.jquery.com/Events/live#typefn. On Mon, Mar 30, 2009 at 9:04 AM, Már Örlygsson wrote: > > > I believe this is a bug. Is there a workaround/fix tet? > > It's in

[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-30 Thread John Campbell
On Sun, Mar 29, 2009 at 7:12 AM, Gilles wrote: > Also could you explain what  $.getScript(scripts[n++], > arguments.callee);  actually does? I am not sure of what > arguments.callee refers to. It is the function itself. It was put in to the language to make recursion of an anonymous function p

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread Brandon Aaron
That is correct and to add to the solution... I'd recommend caching the results of the ul selector and leaving out the 'div' part unless it is necessary. var $img = $('.gallery img'), $ul = $('#bild_spel ul'); $img.each(function() { $ul.append(this); }); -- Brandon Aaron On Mon, Mar 30, 2009

[jquery-dev] Re: Inserting content with each?

2009-03-30 Thread John Resig
If I'm understanding the problem correctly, you'll want this: $(".gallery img").clone().appendTo("#bild_spel div ul").wrap(""); (remove the .clone() if you want to move the img elements, as well) --John On Mon, Mar 30, 2009 at 6:48 AM, smurkas wrote: > > Hello. > > I have a situation where

[jquery-dev] Re: Centering on the viewport

2009-03-30 Thread Brandon Aaron
There is a bug open on window dimensions in jQuery 1.3.x... Unfortunately it looks like we have a gap in unit tests that allowed this regression to occur. It looks like it happened in r5985. It will be fixed for the 1.3.3 release but I'm unsure when that release will happen right now. I should be a

[jquery-dev] Re: Centering on the viewport

2009-03-30 Thread Julian Aubourg
Thanks for the quick answer Brandon. And yes, I can live with a nightly build though, as you can imagine, the client is like not understanding what's taking so long (go explain the joy of version migration to a client!). Any timeframe? I could also live with an ugly workaround until it's done if yo

[jquery-dev] Re: Centering on the viewport

2009-03-30 Thread Brandon Aaron
You could pull in the window logic from 1.2.6 ( http://dev.jquery.com/browser/tags/1.2.6/src/core.js#L1338 ) into the 1.3.2 release ( http://dev.jquery.com/browser/tags/1.3.2/src/dimensions.js#L25 ). -- Brandon Aaron On Mon, Mar 30, 2009 at 3:48 PM, Julian Aubourg wrote: > Thanks for the quick an

[jquery-dev] Re: Need help with an IE issue (of course!)

2009-03-30 Thread Gilles
Thank you so much for that John, not only does it works now but I have learn few things as well :) Like in other posts made here, thank you all for your help. http://codeserenity.com/jquery/scriptless/demoX.html -- working on FF3, IE7 and Safari 4 for far :) Thanks again, I can now develop more

[jquery-dev] Re: CONTEXT LOGIC

2009-03-30 Thread Ricardo
The docs say all that is needed: "By default, if no context is specified, $() looks for DOM elements within the context of the current HTML document. If you do specify a context, such as a DOM element or jQuery object, the expression will be matched against the contents of that context." The spe

[jquery-dev] Re: Structure Plugin Authoring

2009-03-30 Thread tres
Thanks, Steve. Appreciate the compliment and advice. I do see a need for it, which is why I did it. Let's just hope the people who do have a say also see a need for it. Something like this is hard to have as 'just a plugin' because if it is ever used for general purpose plugin authoring, then it

[jquery-dev] Re: Structure Plugin Authoring

2009-03-30 Thread tres
Btw, Daniel, I have changed the API to accomodate this. jQuery.plugin.add('name', func || objectOfFuncs), will now add a static plugin and can be called like jQuery.name() or jQuery.name().method1(); Static methods can be applied also by giving a static keyword with the function name: jQuery.pl

[jquery-dev] Re: CONTEXT LOGIC

2009-03-30 Thread DBJDBJ
On Mar 30, 11:12 pm, Ricardo wrote: > The docs say all that is needed: > > "By default, if no context is specified, $() looks for DOM elements > within the context of the current HTML document. If you do specify a > context, such as a DOM element or jQuery object, the expression will > be match