Ha, no problem. Give this piece of code a try:

$("#myid img").eq(0).attr("title",
$('#myid/.markup02/div/.field-item').siblings().eq(0).text());

The .eq(0) method allows you to avoid wrapping the $(...) again. Hope
that helps simplify some of the code.

It looks like you might run into performance issues with that code, so
here's some ways to get the same results, but faster (note: I don't
know your markup, but generally the less times you do "/" or ">", the
better):
$("#myid img:first").attr("title", $('#myid > .markup02 > div >
:first-child').text());

--John

On 5/9/07, Mario Moura <[EMAIL PROTECTED]> wrote:
Now I see you John Resig.  I feel honored talk with you. Congratulations and
tanks for all.

Regards

Mario

2007/5/9, Mario Moura < [EMAIL PROTECTED]>:
> Ok I found here:
>
> http://www.visualjquery.com
> attr(key, value)  ---> Example
>
> But fortunately I found my mistake:
>
> Will work like this
>
> $($("#myid//img").get(0)).attr("title",
$($('#myid/.markup02/div/.field-item').siblings().get(0)).text());
>
> Without ${...}
>
> Regards
>
> Mario
>
>
> 2007/5/9, John Resig < [EMAIL PROTECTED]>:
>
> >
> > Mario -
> >
> > ${...} doesn't, currently, exist in jQuery. Did you find an example
> > somewhere that showed it as working? (It needs to be fixed.)
> >
> > --John
> >
> > On 5/9/07, Mario Moura < [EMAIL PROTECTED]> wrote:
> > > Hi Folks
> > >
> > > I am trying $("img").attr("title", "${this.src}");
> > >
> > > So :
> > >
> > > $("img").attr("title",
> > >
"${$($('#myid/.markup02/div/.field-item').siblings().get(1)).text()}");
> > >
> > > If I insert my function
> > >
$($('#myid/.markup02/div/.field-item').siblings().get(1)).text()
> > > in firebug console I receive "my target text"
> > >
> > > but when I try insert into $("img").attr("title", "${...}  I receive
full
> > > expression "$($('#myid...text()"
> > >
> > > What is missing?
> > >
> > > Mario
> >
>
>
>
> --
> Mário Alberto Chaves Moura
> [EMAIL PROTECTED]
> 31-9157-6000



--
Mário Alberto Chaves Moura
[EMAIL PROTECTED]
31-9157-6000

Reply via email to