[jQuery] Re: listnav, but for tables?

2009-05-04 Thread Tor

Hi, sorry for replying late, what would be interesting would be to be
able to add a letter navigation / filter block to an existing juery
datatables setup, or a table configured with tablesorter. I assume it
would involve selection on tr, but also triggering a repagination. Two
modes would be interesting; filtering, and goto first page based on
the letter selected. I assume also some customisation would be handy
to be able to select which column is used for filtering. These are
just ideas though, just making it work with tr instead of li would be
handy.

On May 3, 2:44 am, Jack Killpatrick  wrote:
> Hi, I wrote the listnav plugin. Can you elaborate a little more on how
> you'd want it to work? There might be a selector we can tweak to make it
> do what you want (like use tr instead of li).
>
> Tor wrote:
> > I'm looking for a plugin like the listnav plugin (demo:
> >http://www.ihwy.com/Labs/Demos/Current/jquery-listnav-plugin.aspx),
> > but for tables?
>
> > I'd like to filter / select rows in a table based on the first letter
> > of one of the rows in the table. The listnav plugin is exactly what
> > I'm after, but it works on ol/ul only, and I need to use it with
> > tables.


[jQuery] Access to the outer object from $.each.

2009-05-04 Thread ShurikAg

I have the code bellow as bellow:

jQ.fn.Form = function(){
//check if the element is a form
if(!jQ(this).is("form")){
alert("Expecting form element!");
return this;
}
jQ(":input", this).each(function(){//iteration
min = jQ(this).attr("min");
if(typeof min == 'undefined'){
return;
}
alert(min);
});

};

How can I access (the right way) to the form object from within
iteration function.


[jQuery] Re: jQuery-way for filtering self + all children

2009-05-04 Thread Brandon Aaron
Yeah, I see what you mean. What about .findAndSelf(selector)? Trying to
stick with existing naming conventions...
Do you have some sample scenarios to go along with this need? Like actual
HTML, etc. Would you mind filing a new enhancement ticket for this?
http://dev.jquery.com/newticket

--
Brandon Aaron

On Mon, May 4, 2009 at 6:57 PM, Pappy  wrote:

>
> While it will be nice to pass in a selector to andSelf, it's a shame
> you'll have to repeat the selector in both the 'find' and 'addSelf'.
> I'd still rather there be only one function necessary.  It's an
> awfully common pattern.  Honestly, I wish 'find' had been this way
> from the start, and there was a descendants function that works like
> 'find' today... it seems much more sane to me.
>
> Hmm... other possible interfaces/names -
> jObject.search(selector)
> jObject.findAll(selector)
> jObject.findInclusive(selector) // my favorite
> jObject.find(selector, "andSelf")
>
> On May 4, 4:47 pm, Brandon Aaron  wrote:
> > FYI... There is an open enhancement ticket that proposes adding an
> optional
> > selector to the .andSelf() method.http://dev.jquery.com/ticket/4446
> > --
> > Brandon Aaron
> >
> > On Mon, May 4, 2009 at 5:11 PM, Pappy  wrote:
> >
> > > Just curious... what's the jQuery-way of saying "Give me all children
> > > that match a filter and include myself if I happen to match as well."?
> >
> > > I've been using -
> >
> > > element.find("*").andSelf().filter([myfilter])
> >
> > > but that seems kludgy.  Is there a better way? If not, I'll just wrap
> > > this as "findInclusive" or "find([filter], true)" or something.
>


[jQuery] Re: parent element jumps when child fades in or out

2009-05-04 Thread Jordon Bedwell

Try making the element display:inline; instead of block.  Or speed up the
animation.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of chadwithuhc
Sent: Sunday, May 03, 2009 11:57 PM
To: jQuery (English)
Subject: [jQuery] parent element jumps when child fades in or out


hello all,

i am curious if there is a simple solution to this very common problem
im sure lots get.

i have a div with some children items in it and when i fade one of
them out the div jumps down to the appropriate height. i would like to
know is there a simple way to animate the div to shrink nicely instead
of just jumping to its new size?

thanks.



[jQuery] Re: How to select all text in a div except ul

2009-05-04 Thread mkmanning

Sorry, maybe my response was somewhat confusing, but I don't believe
you'll get a concatenated string (as the OP's followup indicates).

After using .filter(), you'll get an array-like object (it's still the
jQuery object) which contains the text nodes.
Calling .text() on those won't actually concatenate them though, as
they're text nodes.

Likewise, if you do $('div').contents().text() you'll only get the
text of the UL element, rather than a concatenation of that with the
previous text node.

@nick, you can get the text from the object with text[0].nodeValue.

HTH :)

On May 3, 4:08 pm, Karl Swedberg  wrote:
> On May 2, 2009, at 9:28 PM, mkmanning wrote:
>
> > Don't use .text(), you'll get an array-like object of text nodes.
>
> Tiny clarification: you'll get a concatenated string of text nodes.
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On May 2, 2009, at 9:28 PM, mkmanning wrote:
>
>
>
> > Don't use .text(), you'll get an array-like object of text nodes. Try
>
> > var text = $('div').contents().filter(function(){return
> > this.nodeType==3;});
> > console.log(text)
>
> > On May 2, 6:06 pm, nick  wrote:
> >> Thanks for the response. Are you sure thats correct though?
>
> >> alert($('div').contents().filter(function(){return
> >> this.nodeType==3;}).text());
>
> >> returns empty.


[jQuery] Re: image for public usage

2009-05-04 Thread Tim Johnson

On Monday 04 May 2009, Sam Sherlock wrote:
> http://docs.jquery.com/Design_and_Identity

Thanks a lot! Does the trick..
 tj


[jQuery] grid-based page editor

2009-05-04 Thread Milan Andric

Hello,

I’m looking for a javascript grid-based page editor, for lack of a
better term. Some javascript code that takes a set of vanilla html div
blocks and allows you to order them, move them, expand contract and
maintains the grid system in a fixed width interface, like 12 column
960. The javascript generates the right grid code and you can save it
or do an XMLHTTPRequest post to save it. Any ideas or have you seen
something like this?

This grid idea is kind of a nicety, really any javascript that allows
you to layout a block on a fixed width page would be great.  Please
let me know if you have run into some code that does this.

Thanks,

Milan
django-newsroom



[jQuery] Re: jQuery-way for filtering self + all children

2009-05-04 Thread Pappy

While it will be nice to pass in a selector to andSelf, it's a shame
you'll have to repeat the selector in both the 'find' and 'addSelf'.
I'd still rather there be only one function necessary.  It's an
awfully common pattern.  Honestly, I wish 'find' had been this way
from the start, and there was a descendants function that works like
'find' today... it seems much more sane to me.

Hmm... other possible interfaces/names -
jObject.search(selector)
jObject.findAll(selector)
jObject.findInclusive(selector) // my favorite
jObject.find(selector, "andSelf")

On May 4, 4:47 pm, Brandon Aaron  wrote:
> FYI... There is an open enhancement ticket that proposes adding an optional
> selector to the .andSelf() method.http://dev.jquery.com/ticket/4446
> --
> Brandon Aaron
>
> On Mon, May 4, 2009 at 5:11 PM, Pappy  wrote:
>
> > Just curious... what's the jQuery-way of saying "Give me all children
> > that match a filter and include myself if I happen to match as well."?
>
> > I've been using -
>
> > element.find("*").andSelf().filter([myfilter])
>
> > but that seems kludgy.  Is there a better way? If not, I'll just wrap
> > this as "findInclusive" or "find([filter], true)" or something.


[jQuery] Re: jQuery-way for filtering self + all children

2009-05-04 Thread Brandon Aaron
FYI... There is an open enhancement ticket that proposes adding an optional
selector to the .andSelf() method. http://dev.jquery.com/ticket/4446
--
Brandon Aaron

On Mon, May 4, 2009 at 5:11 PM, Pappy  wrote:

>
> Just curious... what's the jQuery-way of saying "Give me all children
> that match a filter and include myself if I happen to match as well."?
>
> I've been using -
>
> element.find("*").andSelf().filter([myfilter])
>
> but that seems kludgy.  Is there a better way? If not, I'll just wrap
> this as "findInclusive" or "find([filter], true)" or something.


[jQuery] jQuery-way for filtering self + all children

2009-05-04 Thread Pappy

Just curious... what's the jQuery-way of saying "Give me all children
that match a filter and include myself if I happen to match as well."?

I've been using -

element.find("*").andSelf().filter([myfilter])

but that seems kludgy.  Is there a better way? If not, I'll just wrap
this as "findInclusive" or "find([filter], true)" or something.


[jQuery] Re: How to select all text in a div except ul

2009-05-04 Thread nick

That still seems to only return an object rather than a string. This
works though...

alert($('div').clone().children().remove().end().text());

Is there a better way to get a string than that?



On May 2, 6:28 pm, mkmanning  wrote:
> Don't use .text(), you'll get an array-like object of text nodes. Try
>
> var text = $('div').contents().filter(function(){return
> this.nodeType==3;});
> console.log(text)
>
> On May 2, 6:06 pm, nick  wrote:
>
>
>
> > Thanks for the response. Are you sure thats correct though?
>
> > alert($('div').contents().filter(function(){return
> > this.nodeType==3;}).text());
>
> > returns empty.- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: image for public usage

2009-05-04 Thread Sam Sherlock
see these
http://docs.jquery.com/Design_and_Identity

http://blog.jquery.com/2006/11/07/jquery-button-contest-winners/

- S


2009/5/4 Tim Johnson 

>
> Since jQuery is one of my "tools" - I'd like an appropriately
> "public" image to use on my website.
>
> Are any available?
> thanks
> tim
>


[jQuery] image for public usage

2009-05-04 Thread Tim Johnson

Since jQuery is one of my "tools" - I'd like an appropriately
"public" image to use on my website.

Are any available?
thanks
tim


[jQuery] Solution: extended nextUntil to wrap multiple sibling elements inside a common container element :)

2009-05-04 Thread Kristian


jQuery.fn.nextUntil = function(expr, includes){
var match = [];
includeFirst = includes.first ? true : false;
includeLast = includes.last ? true :
false;
// We need to figure out which elements to push onto
the array
this.each(function(){
// Traverse through the sibling nodes
if (includeFirst)
match.push(this);
for (var i = this.nextSibling; i; i =
i.nextSibling) {
// Make sure that we're only dealing with
elements
if (i.nodeType != 1)
continue;

// Add it on to the stack if include is set
if (includeLast) {
match.push(i);
}
// If we find a match then we need to stop
if (jQuery.filter(expr, [i]).length)
break;

// Add it on to the stack if include is not
set
if (!includeLast) {
match.push(i);
}
}
});
return this.pushStack(match, arguments);
}


$(document).ready(function(){
$('label').each(function(){
$(this).nextUntil('label', {first: true, last:
false}).wrapAll('
'); }); }); Name Age

[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Blaine

Expanding on my example below, with the each function.

First final all elements. Then do whatever you want with the element.

$("span[printData]").each( function( key, elementRef){
alert( $(elementRef).text() );
});

On May 4, 2:16 pm, Andy H  wrote:
> Here is an actual example.  Would anyone know why this isn't working?
> What I find weird is if I do a single line (    alert($("span").attr
> ("printElement"));    ) it works fine.  But if I try to use the each()
> function following it, nothing happens.
>
> Any help would be great.
>
> Thanks!
>
> HTML:
>
> This is the first span
> 1
> This is the first span 2 span>
> This is the first span 3
> This is the first span 4 span>
> This is the first span 5
> This is the first span 6 span>
> This is the first span 7
> This is the first span 8
> This is the first span 9
>
> Output:
> 
>
> Javascript:
>
>         $(document).ready(function() {
>
>             //alert($("span").attr("printElement"));
>
>             $("span").each(function() {
>                 $(this).attr("printElement").each(function() {
>
>                 });
>             });
>
>         }
>
> On May 4, 1:33 pm, Andy H  wrote:
>
> > For some reason this post disappeared.  Can anyone answer this?
>
> > Thanks!
>
> > On May 1, 10:01 am, Andy  wrote:
>
> > > This is an odd questions.  I have a huge form with a lot of data.
> > > There is a table that data in it I need to display on a print screen
> > > (of course this data isn't being displayed in the regular table).  So,
> > > I put the display text in a span tag.
>
> > > So, this is how each item will look:
>
> > > Item 1
> > > Item 2
>
> > > I need a way to grab all spans on the page that have the attributte of
> > > "printData" and grab that text inside that attribute and print it out.
>
> > > Any thoughts?- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Blaine

You need to read the jquery selector docs at
http://docs.jquery.com/Selectors/attributeHas#attribute


Below is the code that will get your data.
 $("span[printData]").text();



On May 4, 12:33 pm, Andy H  wrote:
> For some reason this post disappeared.  Can anyone answer this?
>
> Thanks!
>
> On May 1, 10:01 am, Andy  wrote:
>
> > This is an odd questions.  I have a huge form with a lot of data.
> > There is a table that data in it I need to display on a print screen
> > (of course this data isn't being displayed in the regular table).  So,
> > I put the display text in a span tag.
>
> > So, this is how each item will look:
>
> > Item 1
> > Item 2
>
> > I need a way to grab all spans on the page that have the attributte of
> > "printData" and grab that text inside that attribute and print it out.
>
> > Any thoughts?


[jQuery] Re: Question in JSON

2009-05-04 Thread MorningZ

if you had:

var json = {"4":{"6":"1"},"3":{"1":"1","2":"1"}}

and this div:



then this code:

$.each(json, function(Parent, Values) {
   $("#Results").append("Parent: " + Parent + "");
   $.each(values, function(key, val) {
  $("#Results").append("-- Key: " + key + ", Value: " +
val + "");
   });
});

Would result in

Parent: 4
-- Key: 6, Value 1
Parent 3
-- Key: 1, Value 1
-- Key: 2, Value 1





On May 4, 1:56 pm, Dman  wrote:
> Hello, I recently learnt jQuery but I am having problems on working
> with JSON. I am loading the JSON data from PHP file using $.getJSON.
> The JSON returned is {"4":{"6":"1"},"3":{"1":"1","2":"1"}} and array
> for reference is
> Array
> (
>     [4] => Array
>         (
>             [6] => 1
>         )
>
>     [3] => Array
>         (
>             [1] => 1
>             [2] => 1
>         )
>
> )
> The problem is that I don't know the JSON values. Is there any way I
> can loop through JSON so I can access "4", its child "6" and value 1?
> Or I will have to make another JSON structure?


[jQuery] Re: unwanted delay with css()

2009-05-04 Thread Ricardo

On May 1, 10:25 am, bluejohn  wrote:
> Hi,
>
> I'm running an A/B test using a 3rd party javascript testing app.  I'm
> loading the jquery script with the tool.
>
> 
>   $(document).ready(function(){
>       $(".cartInStock").css({display : " none "});
>   });
>   
>
> The problem is that the original CSS displays (what I want to hide)
> while the page is loading, but as soon as it finishes the the script
> updates the css and the element disappears.
>
> The script itself loads fairly high up on the page.  I'm not sure if
> this is the script or the A/B testing tool causing the delay.
>
> Any suggestions?

It depends on the size of your document. The function you passed to
ready() will be executed only after the whole DOM has loaded, if your
page is long it's likely that you'll have a delay.

See here for a practical alternative (ignore the fancy title):
http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content


[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Andy H

Here is an actual example.  Would anyone know why this isn't working?
What I find weird is if I do a single line (alert($("span").attr
("printElement"));) it works fine.  But if I try to use the each()
function following it, nothing happens.


Any help would be great.

Thanks!






HTML:

This is the first span
1
This is the first span 2
This is the first span 3
This is the first span 4
This is the first span 5
This is the first span 6
This is the first span 7
This is the first span 8
This is the first span 9


Output:





Javascript:

$(document).ready(function() {

//alert($("span").attr("printElement"));

$("span").each(function() {
$(this).attr("printElement").each(function() {

});
});

}

On May 4, 1:33 pm, Andy H  wrote:
> For some reason this post disappeared.  Can anyone answer this?
>
> Thanks!
>
> On May 1, 10:01 am, Andy  wrote:
>
>
>
> > This is an odd questions.  I have a huge form with a lot of data.
> > There is a table that data in it I need to display on a print screen
> > (of course this data isn't being displayed in the regular table).  So,
> > I put the display text in a span tag.
>
> > So, this is how each item will look:
>
> > Item 1
> > Item 2
>
> > I need a way to grab all spans on the page that have the attributte of
> > "printData" and grab that text inside that attribute and print it out.
>
> > Any thoughts?- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: jquery object and functions

2009-05-04 Thread Jordon Bedwell

We'd have to see more of the source code than to diagnose the issue, it's
far beyond that local piece.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of introvert
Sent: Monday, May 04, 2009 2:55 PM
To: jQuery (English)
Subject: [jQuery] Re: jquery object and functions


I get the same error.

On May 4, 9:51 pm, "Jordon Bedwell"  wrote:
> Try:
>
> $(this).find('img').attr({'src':img[n][0],'alt':img[n][1]});
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of introvert
> Sent: Monday, May 04, 2009 2:38 PM
> To: jQuery (English)
> Subject: [jQuery] jquery object and functions
>
> Hello.
>
> I'm having problems with the  following code:
>
> var img = [];
> //
> var o = this.find('img');
> o.attr('src', img[n][0]).attr('alt', img[n][1]);
>
> The error I get is:
> o.attr("src", img[n][0]).attr is not a function
>
> What am I doing wrong?
>
> Many thanks in advance!



[jQuery] Re: jquery object and functions

2009-05-04 Thread introvert

I get the same error.

On May 4, 9:51 pm, "Jordon Bedwell"  wrote:
> Try:
>
> $(this).find('img').attr({'src':img[n][0],'alt':img[n][1]});
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of introvert
> Sent: Monday, May 04, 2009 2:38 PM
> To: jQuery (English)
> Subject: [jQuery] jquery object and functions
>
> Hello.
>
> I'm having problems with the  following code:
>
> var img = [];
> //
> var o = this.find('img');
> o.attr('src', img[n][0]).attr('alt', img[n][1]);
>
> The error I get is:
> o.attr("src", img[n][0]).attr is not a function
>
> What am I doing wrong?
>
> Many thanks in advance!


[jQuery] Re: jquery object and functions

2009-05-04 Thread Jordon Bedwell

Try:

$(this).find('img').attr({'src':img[n][0],'alt':img[n][1]});

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of introvert
Sent: Monday, May 04, 2009 2:38 PM
To: jQuery (English)
Subject: [jQuery] jquery object and functions


Hello.

I'm having problems with the  following code:

var img = [];
//
var o = this.find('img');
o.attr('src', img[n][0]).attr('alt', img[n][1]);

The error I get is:
o.attr("src", img[n][0]).attr is not a function

What am I doing wrong?

Many thanks in advance!



[jQuery] Re: need some suggestion about adding active class for one page link

2009-05-04 Thread jQnoob

thanks so much for the reply!

I was able to apply the class but was unable to figure out how to
remove the existing active class on other links.  I'll try this out.

Again, thanks so much!

On May 4, 7:48 am, Nathan  wrote:
> If I understand you both correctly.
>
> You'll need to add a class of active to the clicked nav item and
> remove the class active from the nav item the was previously active.
>
> You can do this with:
>
> $(function(){
>         $('#nav li a').click(function(){
>                 $('#nav li a').removeClass('active');
>                 $(this).addClass('active');
>         });
>
> });
>
> $('#nav li a').click - Gets the click.
> $('#nav li a').removeClass('active') - Removes the class active from
> all #nav li a
> $(this).addClass('active') - The 'this' in that statement defines the
> #nav li a that was clicked
>
> On May 3, 12:24 pm, jQnoob  wrote:
>
> > I'm also having this problem.  I'm using localscroll on a one-page
> > site and need to add an active state to the navigation items.  the
> > problem is, it doesn't seem to work with local anchors. Not sure if it
> > matters, but I also have sticky header and footer.
>
> > Here's some example code:
>
> > HTML:
> > 
> > 
> > logo
> > 
> > home
> > about
> > portfolio
> > contact
> > rss > a>Subscribe to our RSS Feed
> > 
> > 
> > 
>
> > JSCRIPT:
> > jQuery(function( $ ){
>
> >         // Scroll the x axis
> >         $.localScroll.defaults.axis = 'x';
>
> >         // Scroll if there's a hash (#something) in the url
> >         $.localScroll.hash({
> >                 target: '#content', // Could be a selector or a jQuery 
> > object too.
> >                 queue:true,
> >                 duration:1500
> >         });
>
> >         /**
> >          * NOTE: I use $.localScroll instead of $('#navigation').localScroll
> > () so I
> >          * also affect the >> and << links. I want every link in the page to
> > scroll.
> >          */
> >         $.localScroll({
> >                 target: '#content', // could be a selector or a jQuery 
> > obje8¶ct too.
> >                 queue:true,
> >                 duration:1000,
> >                 hash:true,
> >                 onBefore:function( e, anchor, $target ){
> >                         // The 'this' is the settings object, can be 
> > modified
> >                 },
> >                 onAfter:function( anchor, settings ){
> >                         // The 'this' contains the scrolled element 
> > (#content)
> >                 }
> >         });
>
> > $(function(){
> >    var path = location.pathname.substring(1);
> >    if ( path )
> >      $('ul#nav li a...@href$="' + path + '"]').attr('class', 'active');
> >  });


[jQuery] Re: empty() is faking ?

2009-05-04 Thread Olivier Percebois-Garve

That explains my issue very well and will save me a lot of headaches.

(and gives a few ideas for a debug plugin)

thank you

-Olivier

Ricardo wrote:

Could not make much sense out of your video either :D

The thing is: when you log an object or element in firebug, it's just
a reference to the object itself, not a snapshot of it at that instant
in time. It will always show the object as it is *now*. Try this in
the console:

x = {a:1};
console.log(x);
x.a = 2;

You'll see that x.a == 2 in the object inspector, not 1. If you
further change x's properties they will continue to be updated in the
inspector. The printed line will not, it will keep showing "Object
a=1", ignore it.

On May 4, 3:30 pm, Olivier Percebois-Garve 
wrote:
  

Ricardo wrote:


On May 4, 11:33 am, Olivier Percebois-Garve 
wrote:
  

Hi

I'm puzzled with this :http://pastebin.me/49fef93928aff

(in firebug click on the jquery object, then expand "0")

Using empty() or remove() on the lis of a ul, it seems that jQuery is

"faking" to remove them,
i.e the lis will not be accessible by jQuery anymore, but in reality the
childnodes are still there.
Well, at least that's what I can believe from firebug. (Not sure who's
the liar here jQuery, firebug, or me being dumb)

I'm facing an issue that gets down to that, I really dont understand

whats going on and how to handle it.
(using jQuery 1.2.6)

I hope I am missing the obvious. Am I ?

-Olivier


The LIs you see in Firebug are you the ones you appended at the end of
your script:
$('#u2').append($lis);
  
The childNodes property is a live collection, it updates as you change

the DOM. Remove the line I mentioned and you'll see the LIs are being
removed correctly, or try appending more items to the list and you'll
see childNodes updating accordingly.
  
cheers

-- ricardo
  

Ha !

Thank you very much, "live collection" explains it.
I already did what you said, but I could not make sense out of it.

Is this also solving my other weird issue ? Are object properties also
"live" ?
I had properties becoming "undefined" once I click the logged object :

http://www.screencast.com/users/olivvv/folders/Jing/media/7e598646-3b...

-Olivier



  




[jQuery] jquery object and functions

2009-05-04 Thread introvert

Hello.

I'm having problems with the  following code:

var img = [];
//
var o = this.find('img');
o.attr('src', img[n][0]).attr('alt', img[n][1]);

The error I get is:
o.attr("src", img[n][0]).attr is not a function

What am I doing wrong?

Many thanks in advance!


[jQuery] Re: empty() is faking ?

2009-05-04 Thread Ricardo

Could not make much sense out of your video either :D

The thing is: when you log an object or element in firebug, it's just
a reference to the object itself, not a snapshot of it at that instant
in time. It will always show the object as it is *now*. Try this in
the console:

x = {a:1};
console.log(x);
x.a = 2;

You'll see that x.a == 2 in the object inspector, not 1. If you
further change x's properties they will continue to be updated in the
inspector. The printed line will not, it will keep showing "Object
a=1", ignore it.

On May 4, 3:30 pm, Olivier Percebois-Garve 
wrote:
> Ricardo wrote:
> > On May 4, 11:33 am, Olivier Percebois-Garve 
> > wrote:
>
> >> Hi
>
> >> I'm puzzled with this :http://pastebin.me/49fef93928aff
>
> >> (in firebug click on the jquery object, then expand "0")
>
> >> Using empty() or remove() on the lis of a ul, it seems that jQuery is
> >> "faking" to remove them,
> >> i.e the lis will not be accessible by jQuery anymore, but in reality the
> >> childnodes are still there.
> >> Well, at least that's what I can believe from firebug. (Not sure who's
> >> the liar here jQuery, firebug, or me being dumb)
>
> >> I'm facing an issue that gets down to that, I really dont understand
> >> whats going on and how to handle it.
> >> (using jQuery 1.2.6)
>
> >> I hope I am missing the obvious. Am I ?
>
> >> -Olivier
>
> > The LIs you see in Firebug are you the ones you appended at the end of
> > your script:
> > $('#u2').append($lis);
>
> > The childNodes property is a live collection, it updates as you change
> > the DOM. Remove the line I mentioned and you'll see the LIs are being
> > removed correctly, or try appending more items to the list and you'll
> > see childNodes updating accordingly.
>
> > cheers
> > -- ricardo
>
> Ha !
>
> Thank you very much, "live collection" explains it.
> I already did what you said, but I could not make sense out of it.
>
> Is this also solving my other weird issue ? Are object properties also
> "live" ?
> I had properties becoming "undefined" once I click the logged object :
>
> http://www.screencast.com/users/olivvv/folders/Jing/media/7e598646-3b...
>
> -Olivier


[jQuery] Re: cluetip plugin: how to implement a cluetip picture to a homepage logo?

2009-05-04 Thread flyfisherman

Sorry for that I did not see a missed that folder js...

It works now, looks nice in Safari Win, Opera Win. But in IE 8 and
Firefox 3.03 the logo has now that awful link border. How can I change
that?
Txs
Markus

On 4 Mai, 21:09, Karl Swedberg  wrote:
> For starters, change the src value in these lines:
>
>  script> 
>