How about:
var first_paragraphs = $('#book div.page p:first');
Joel.
On 06/06/2007, at 12:34 AM, Sebastián V. Würtz wrote:
How i get the first p of each div page inside the id book?
This not work
$('#book .page').each(function(index) {
var first_paragraph = $(this + p).eq(0);
div
: Tuesday, June 05, 2007 11:40 AM
Subject: [jQuery] Re: Problem getting first paragraph
How about:
var first_paragraphs = $('#book div.page p:first');
Joel.
On 06/06/2007, at 12:34 AM, Sebastián V. Würtz wrote:
How i get the first p of each div page inside the id book?
This not work
$('#book
On 06/06/2007, at 12:48 AM, Sebastián V. Würtz wrote:
Right. but i need all the first paragraph of each page, to
execute an each function for each one :)
Sorry if I am misunderstanding, but as far as I can tell this should
work:
$('#book div.page p:first').each(function() {
/*do
On 06/06/2007, at 12:57 AM, Joel Birch wrote:
On 06/06/2007, at 12:48 AM, Sebastián V. Würtz wrote:
Right. but i need all the first paragraph of each page, to
execute an each function for each one :)
Sorry if I am misunderstanding, but as far as I can tell this
should work:
$('#book
ill notice, but still can make it work, im checking the html generated by
the php, or make a new clean code for test.
:)
thx
- Original Message -
From: Joel Birch [EMAIL PROTECTED]
To: jquery-en@googlegroups.com
Sent: Tuesday, June 05, 2007 12:02 PM
Subject: [jQuery] Re: Problem
Try this.
Given the following HTML:
div id=book
div class=page
pParagraph one, page one/p
pParagraph two, page one/p
pParagraph three, page one/p
/div
div class=page
pParagraph one, page two/p
On 06/06/2007, at 1:13 AM, Michael Price wrote:
The following jQuery code should do the trick:
$(#book .page).each(function() {
$(p:first,this).css(backgroundColor,yellow);
});
Thanks Michael., that should do it. So Sebastián's solution could
look like:
$(#book
On 06/06/2007, at 1:30 AM, Joel Birch wrote:
$('p:first','#book .page').each(function(){
/* do stuff ... */
});
Actually, :first may only ever return one element, maybe this works
better:
$('p:eq(0)','#book .page').each(function(){
/* do stuff ... */
});
Sorry for the
Birch [EMAIL PROTECTED]
Para: jquery-en@googlegroups.com
Enviado: martes 5 de junio de 2007, 12:34:18
Asunto: [jQuery] Re: Problem getting first paragraph
On 06/06/2007, at 1:30 AM, Joel Birch wrote:
$('p:first','#book .page').each(function(){
/* do stuff ... */
});
Actually, :first may
: [jQuery] Re: Problem getting first paragraph
On 06/06/2007, at 1:30 AM, Joel Birch wrote:
$('p:first','#book .page').each(function(){
/* do stuff ... */
});
Actually, :first may only ever return one element, maybe this works
better:
$('p:eq(0)','#book .page').each(function(){
/* do stuff
10 matches
Mail list logo