Chaining same data twice?

0 views
Skip to first unread message

Eshan

unread,
Sep 1, 2008, 12:08:36 PM9/1/08
to chainjs
I have the following markup:

<body>
Hello,
<span id="hello" class="user">
<span class="firstname"></span>&nbsp;
<span class="lastname"></span>
</span>!

Goodbye
<span id="goodbye" class="user">
<span class="firstname"></span>&nbsp;
<span class="lastname"></span>
</span>!
</body>

The following lines populate both sections properly:

$('#hello').item(user).chain();
$('#goodbye').item(user).chain();

But this line does not:

$('.user').item(user).chain();

Is this working as intended?

Rizqi Ahmad

unread,
Sep 1, 2008, 12:36:44 PM9/1/08
to chainjs
yeah, there are some limitation regarding multiple elements. currently
you have to do $('.user').each(function(){$(this).chain()})

Eshan

unread,
Sep 1, 2008, 11:07:08 PM9/1/08
to chainjs
Thanks, $('.user').each(function(){$(this).item(user).chain()}); did
work.
Reply all
Reply to author
Forward
0 new messages