[jQuery] Re: Selector help needed

2009-07-24 Thread Michael Lawson

Links that have inner "active" links?

$("a:has(ul li a.active)").css("active");


i think that'll work if i understood you right

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


   
  From:   iceangel89 
   
  To: "jQuery (English)"   
   
  Date:   07/24/2009 09:24 AM  
           
  Subject:[jQuery] Re: Selector help needed
   






sorry the code is


Link 1

Link 2

Link 2.1
Link 2.2





On Jul 24, 9:20 pm, iceangel89  wrote:
> with the markup like:
>
> <ul>
>     <li><a href="#">Link 1</a></li>
>     <li>
>         <a href="#">Link 2</a>
>         <ul>
>             <li><a href="#"
> class="active">Link 2.1</a></li>
>             <li><a href="#">Link 2.2</
> a></li>
>         </ul>
>     </li>
> </ul>
> 
>
> i want to add a class "active" to , Link 2 (line 4), or links that
> have inner a.active links. how can i do it with jquery or even pure
> css?

<><>

[jQuery] Re: Selector help needed

2009-07-24 Thread iceangel89

sorry the code is


Link 1

Link 2

Link 2.1
Link 2.2





On Jul 24, 9:20 pm, iceangel89  wrote:
> with the markup like:
>
> 
> 
>
> i want to add a class "active" to , Link 2 (line 4), or links that
> have inner a.active links. how can i do it with jquery or even pure
> css?


[jQuery] Re: Selector help

2009-07-19 Thread Ricardo

this is an object name, you want to pass the object itself and not a
string, as others have already said:

$(this).find('+ h1')
or
$('+ h1', this)
or
$(this).next('h1')

http://docs.jquery.com/Selectors

On Jul 19, 4:46 am, Dhruva Sagar  wrote:
> Hi,
>
> Perhaps your missing a space? $('this h1'), or $('this ' + 'h1')
> What I don't understand is, why are you trying to concatenate two
> strings when you don't need to?
>
> 
> Thanks & Regards,
> Dhruva Sagar.
>
> On Sat, 2009-07-18 at 22:05 -0700, Warfang wrote:
> > I'm pretty new to Javascript/ jQuery, so this is really bugging me.
>
> > I'm trying to get the height of an h1 that is a sibling to this. The
> > value for the variable h1Height, however, returned as null in the
> > console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
> > to see what it was interpreted as. It brought back this+h1, which
> > should select an h1 adjacent to this (which is a div).
>
> > Javascript
> > h1Height =  $('this'+'h1').height();
>
> > What went wrong?
>
>
>
>  draft-paper.png
> < 1KViewDownload


[jQuery] Re: Selector help

2009-07-19 Thread Dhruva Sagar
Hi,

Perhaps your missing a space? $('this h1'), or $('this ' + 'h1')
What I don't understand is, why are you trying to concatenate two
strings when you don't need to? 


Thanks & Regards,
Dhruva Sagar.


On Sat, 2009-07-18 at 22:05 -0700, Warfang wrote:

> I'm pretty new to Javascript/ jQuery, so this is really bugging me.
> 
> I'm trying to get the height of an h1 that is a sibling to this. The
> value for the variable h1Height, however, returned as null in the
> console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
> to see what it was interpreted as. It brought back this+h1, which
> should select an h1 adjacent to this (which is a div).
> 
> Javascript
> h1Height =  $('this'+'h1').height();
> 
> What went wrong?
<>

[jQuery] Re: Selector help

2009-07-19 Thread Charlie


absolutely right, and I know better, was far too late at night...thanks 
for the catch


Shawn wrote:


that would still fail - unless he has a tag named "this"  just like 
doing $("a") finds anchor tags.  If however he is using "this" in terms 
of an event handler (where "this" is a reference to the DOM object that 
threw the event, then he would need to remove the quotes:


$(this).siblings('h1').height();

In this case "$(this)" says to put the jquery wrapper object around the 
DOM element represented by "this" in the current context.


The difference is very minor, I know, but I did not see in his 
description just what "this" represented...


Shawn

Charlie wrote:
you can't use "this" in same manner as tagnames, ID's or class as a 
selector in combination with other selectors the way you are attempting.


try:

h1Height =  $('this').siblings('h1').height();




Warfang wrote:

I'm pretty new to Javascript/ jQuery, so this is really bugging me.

I'm trying to get the height of an h1 that is a sibling to this. The
value for the variable h1Height, however, returned as null in the
console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
to see what it was interpreted as. It brought back this+h1, which
should select an h1 adjacent to this (which is a div).

Javascript
h1Height =  $('this'+'h1').height();

What went wrong?

  






[jQuery] Re: Selector help

2009-07-19 Thread Shawn


that would still fail - unless he has a tag named "this"  just like 
doing $("a") finds anchor tags.  If however he is using "this" in terms 
of an event handler (where "this" is a reference to the DOM object that 
threw the event, then he would need to remove the quotes:


$(this).siblings('h1').height();

In this case "$(this)" says to put the jquery wrapper object around the 
DOM element represented by "this" in the current context.


The difference is very minor, I know, but I did not see in his 
description just what "this" represented...


Shawn

Charlie wrote:
you can't use "this" in same manner as tagnames, ID's or class as a 
selector in combination with other selectors the way you are attempting.


try:

h1Height =  $('this').siblings('h1').height();




Warfang wrote:

I'm pretty new to Javascript/ jQuery, so this is really bugging me.

I'm trying to get the height of an h1 that is a sibling to this. The
value for the variable h1Height, however, returned as null in the
console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
to see what it was interpreted as. It brought back this+h1, which
should select an h1 adjacent to this (which is a div).

Javascript
h1Height =  $('this'+'h1').height();

What went wrong?

  




[jQuery] Re: Selector help

2009-07-18 Thread Charlie





you can't use "this" in same manner as tagnames, ID's or class as a
selector in combination with other selectors the way you are
attempting. 

try:
h1Height =  $('this').siblings('h1').height();




Warfang wrote:

  I'm pretty new to _javascript_/ jQuery, so this is really bugging me.

I'm trying to get the height of an h1 that is a sibling to this. The
value for the variable h1Height, however, returned as null in the
console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
to see what it was interpreted as. It brought back this+h1, which
should select an h1 adjacent to this (which is a div).

_javascript_
h1Height =  $('this'+'h1').height();

What went wrong?

  






[jQuery] Re: Selector help

2009-07-18 Thread Michael Lawson

Selectors are strings, including the special operators.  So your select
should look like this:

'this + h1'.  What you have there just concatenates the two strings
together making your selector 'thish1'

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Whether one believes in a religion or not,
and whether one believes in rebirth or not,
there isn't anyone who doesn't appreciate kindness and compassion..'


   
  From:   Warfang
   
  To: "jQuery (English)"   
   
  Date:   07/19/2009 01:11 AM  
   
  Subject:[jQuery] Selector help   
   






I'm pretty new to Javascript/ jQuery, so this is really bugging me.

I'm trying to get the height of an h1 that is a sibling to this. The
value for the variable h1Height, however, returned as null in the
console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
to see what it was interpreted as. It brought back this+h1, which
should select an h1 adjacent to this (which is a div).

Javascript
h1Height =  $('this'+'h1').height();

What went wrong?

<><>

[jQuery] Re: Selector help

2009-06-04 Thread Charlie





invalid code  





Dave Maharaj :: WidePixels.com wrote:

  I am cleaning up some html code and
originally i had
  
  
  
    
  Profile Settings
  
    
  echo $preference['name'] . ', ';
    endforeach; ?>
  
    
  

   
  but the DIV inside the LI was too much so I
went with adding the id="profile to  but script is no longer
working 
   
  
  
  
  Profile Settings
  
    
  echo $preference['name'] . ', ';
    endforeach; ?>
  
    

   
  SCRIPT:
  $("a[class^='edit_']").click(function(){
 var url_id = $(this).attr('href');
 var x = $(this).attr('id').split('_');
 var y = x[0];
 var z = x[1];
  $("#loading_"+z).show("fast", function() {
   $("#"+z).slideUp( 1000, function(){
$(".edit_"+z).hide(0.1, function() {
 $("#"+z).load( url_id , function(){
  $("#"+z).slideDown( 1000, function() {
   $("#loading_"+z).hide(function(){
$("#"+z).fadeTo("fast", 1, function() {
 $("#"+z).fadeIn("slow");
});  
   }); 
  });
 return false;
 });
});
   });
  });
 });
   
  Do i eed to edit the selecot as li#?
   
  Dave 






[jQuery] Re: Selector help

2009-06-04 Thread Stephen Sadowski


Unrelated to your issue, I would consider an effects queue.

Just sayin'

On Thu, 4 Jun 2009 15:17:24 -0230, "Dave Maharaj :: WidePixels.com"
 wrote:
> I am cleaning up some html code and originally i had
> 
>   
>   
> 
>   Profile Settings
>   
>echo $preference['name'] . ', ';
> endforeach; ?>
>   
> 
>   
> 
>  
> but the DIV inside the LI was too much so I went with adding the
> id="profile
> to  but script is no longer working 
>  
> 
>   
>   
>   Profile Settings
>   
>echo $preference['name'] . ', ';
> endforeach; ?>
>   
> 
> 
>  
> SCRIPT:
> $("a[class^='edit_']").click(function(){
>  var url_id = $(this).attr('href');
>  var x = $(this).attr('id').split('_');
>  var y = x[0];
>  var z = x[1];
>   $("#loading_"+z).show("fast", function() {
>$("#"+z).slideUp( 1000, function(){
> $(".edit_"+z).hide(0.1, function() {
>  $("#"+z).load( url_id , function(){
>   $("#"+z).slideDown( 1000, function() {
>$("#loading_"+z).hide(function(){
> $("#"+z).fadeTo("fast", 1, function() {
>  $("#"+z).fadeIn("slow");
> });  
>}); 
>   });
>  return false;
>  });
> });
>});
>   });
>  });
>  
> Do i eed to edit the selecot as li#?
>  
> Dave


[jQuery] Re: Selector help needed

2009-04-28 Thread Jeffrey Kretz

You can also create a closure:

$(document).ready(function(){
   $('#menulinks a').hover(function(){
  var fn = function(el){
 return function(){
$(el).stop().animate({
   top : '40px',
   paddingTop : '40px'
});
el = null;
 };
  }(this);
  setTimeout(fn,1000);
   });
});

The double-function pattern above will create a closure with its own scope,
having a variable named el with a reference to that specific element.

Nulling out that variable helps prevent memory leaks that can be caused by
just such a closure.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of MorningZ
Sent: Tuesday, April 28, 2009 7:35 PM
To: jQuery (English)
Subject: [jQuery] Re: Selector help needed


You'll have to build up the selector as a string  when you call
"setTimeout", that function is run out of the context of being within
that .each statement

so you'll have to do something like (and there's many ways of doing
this, i'll just show quick and easy), and yeah, the 's will have to
have IDs on them

 $(document).ready(function(){
 $('#menulinks a').hover(function(){
 setTimeout('$("#' + this.id + '").stop().animate({
 top : "40px",
 paddingTop : "40px"
 });', 1000);
 });

});




On Apr 28, 10:21 pm, Warfang  wrote:
> Here's my code:
>
> $(document).ready(function(){
>         $('#menulinks a').hover(function(){
>                 setTimeout(function(){
>                         $(this).stop().animate({
>                                 top : '40px',
>                                 paddingTop : '40px'
>                         });
>                 }, 1000);
>         });
>
> });
>
> Before I added a timeout, (this) sufficed. With the timeout set, (this)
did
> not select the hovered link. I tried another selector and it worked fine.
> How can I specify (this) for this situation?
> --
> View this message in
context:http://www.nabble.com/Selector-help-needed-tp23289341s27240p23289341
...
> Sent from the jQuery General Discussion mailing list archive at
Nabble.com.



[jQuery] Re: Selector help needed

2009-04-28 Thread MorningZ

You'll have to build up the selector as a string  when you call
"setTimeout", that function is run out of the context of being within
that .each statement

so you'll have to do something like (and there's many ways of doing
this, i'll just show quick and easy), and yeah, the 's will have to
have IDs on them

 $(document).ready(function(){
 $('#menulinks a').hover(function(){
 setTimeout('$("#' + this.id + '").stop().animate({
 top : "40px",
 paddingTop : "40px"
 });', 1000);
 });

});




On Apr 28, 10:21 pm, Warfang  wrote:
> Here's my code:
>
> $(document).ready(function(){
>         $('#menulinks a').hover(function(){
>                 setTimeout(function(){
>                         $(this).stop().animate({
>                                 top : '40px',
>                                 paddingTop : '40px'
>                         });
>                 }, 1000);
>         });
>
> });
>
> Before I added a timeout, (this) sufficed. With the timeout set, (this) did
> not select the hovered link. I tried another selector and it worked fine.
> How can I specify (this) for this situation?
> --
> View this message in 
> context:http://www.nabble.com/Selector-help-needed-tp23289341s27240p23289341
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Selector Help

2009-01-20 Thread LexHair

Sweet. Thanks, Kean!!

On Jan 18, 4:23 pm, Kean  wrote:
> This works and will take care of unchecked conditions too.
>
> $('table tr[id^=row] :checkbox').click(function(){
>         $$ = $(this);
>         $text = $$.parent().parent().find('.email, .contact');
>
>         if($$.is(':checked')) {
>                 $text[0].value = 'Email Checked';
>                 $text[1].value = 'Contact Checked';
>         }
>         else
>                 $checkbox.val('');
>
> });
>
> On Jan 18, 11:41 am, LexHair  wrote:
>
> > I have a table structure with a multiple rows containing a checkbox
> > input and 4 text inputs with distinct classes. I want to prefill two
> > of the text inputs in the same row where the checkbox is checked.
> > Example code for the first two rows:
>
> > 
> >  
> >    
> >    
> >    
> >    
> >    
> >  
> >   
> >    
> >    
> >    
> >    
> >    
> >  
> > 
>
> > I need help me crafting the correct selector to focus control onto the
> > text input for the input with class="contact" and class="email". I can
> > write the function to manipulate the attributes but I can't figure out
> > the selector. I haven't had any luck with "prev ~ siblings" or "prev +
> > next". Thanks in advance.


[jQuery] Re: Selector Help

2009-01-18 Thread Kean

Oops,   $checkbox.val('');  should be $text.val('');

On Jan 18, 1:23 pm, Kean  wrote:
> This works and will take care of unchecked conditions too.
>
> $('table tr[id^=row] :checkbox').click(function(){
>         $$ = $(this);
>         $text = $$.parent().parent().find('.email, .contact');
>
>         if($$.is(':checked')) {
>                 $text[0].value = 'Email Checked';
>                 $text[1].value = 'Contact Checked';
>         }
>         else
>                 $checkbox.val('');
>
> });
>
> On Jan 18, 11:41 am, LexHair  wrote:
>
> > I have a table structure with a multiple rows containing a checkbox
> > input and 4 text inputs with distinct classes. I want to prefill two
> > of the text inputs in the same row where the checkbox is checked.
> > Example code for the first two rows:
>
> > 
> >  
> >    
> >    
> >    
> >    
> >    
> >  
> >   
> >    
> >    
> >    
> >    
> >    
> >  
> > 
>
> > I need help me crafting the correct selector to focus control onto the
> > text input for the input with class="contact" and class="email". I can
> > write the function to manipulate the attributes but I can't figure out
> > the selector. I haven't had any luck with "prev ~ siblings" or "prev +
> > next". Thanks in advance.


[jQuery] Re: Selector Help

2009-01-18 Thread Kean

This works and will take care of unchecked conditions too.

$('table tr[id^=row] :checkbox').click(function(){
$$ = $(this);
$text = $$.parent().parent().find('.email, .contact');

if($$.is(':checked')) {
$text[0].value = 'Email Checked';
$text[1].value = 'Contact Checked';
}
else
$checkbox.val('');
});

On Jan 18, 11:41 am, LexHair  wrote:
> I have a table structure with a multiple rows containing a checkbox
> input and 4 text inputs with distinct classes. I want to prefill two
> of the text inputs in the same row where the checkbox is checked.
> Example code for the first two rows:
>
> 
>  
>    
>    
>    
>    
>    
>  
>   
>    
>    
>    
>    
>    
>  
> 
>
> I need help me crafting the correct selector to focus control onto the
> text input for the input with class="contact" and class="email". I can
> write the function to manipulate the attributes but I can't figure out
> the selector. I haven't had any luck with "prev ~ siblings" or "prev +
> next". Thanks in advance.


[jQuery] Re: Selector Help

2009-01-18 Thread MorningZ

This is untested and just off the top of my head

$("table tr[id^='row']").each(function () {
   $(this).find("td checkbox").click(function() {
if ($(this).is(":checked") == true) {
 var $row = $(this).parent().parent(); //first is
, second is 
 $row.find("input.contact").val("Your value here");
 $row.find("input.email").val("Your value here");
}
   });
});

On Jan 18, 2:41 pm, LexHair  wrote:
> I have a table structure with a multiple rows containing a checkbox
> input and 4 text inputs with distinct classes. I want to prefill two
> of the text inputs in the same row where the checkbox is checked.
> Example code for the first two rows:
>
> 
>  
>    
>    
>    
>    
>    
>  
>   
>    
>    
>    
>    
>    
>  
> 
>
> I need help me crafting the correct selector to focus control onto the
> text input for the input with class="contact" and class="email". I can
> write the function to manipulate the attributes but I can't figure out
> the selector. I haven't had any luck with "prev ~ siblings" or "prev +
> next". Thanks in advance.


[jQuery] Re: Selector help

2009-01-14 Thread brian

I use this sometimes to have all outside links open in a new tab/window.

$('a[href^="http"]')
.not('[href*=' + window.location.hostname + ']')
.attr('target', '_new');

You could modify that:

$('a[href^="http"]')
.not('[href*=' + window.location.hostname + ']')
.each(function() {
...
});

On Wed, Jan 14, 2009 at 9:54 AM, km...@fensys.com  wrote:
>
> I need to capture all links that navigate away from the current page.
> If a link points back to the current page, it is allowed to go
> through.  If it navigates away, a popup needs to appear displaying
> certain information.  I have two different strings that point pack to
> the current page.  One is a normal url, the other is a javascript
> postback.
>
> On Jan 13, 10:20 pm, brian  wrote:
>> You could maybe follow with not(). What are you trying to do?
>>
>> On Tue, Jan 13, 2009 at 5:26 PM, km...@fensys.com  wrote:
>>
>> > I'm using a attribute selector and I want to combine the *= with the !
>> > = on href.  Is there any way to do this?


[jQuery] Re: Selector help

2009-01-14 Thread km...@fensys.com

I need to capture all links that navigate away from the current page.
If a link points back to the current page, it is allowed to go
through.  If it navigates away, a popup needs to appear displaying
certain information.  I have two different strings that point pack to
the current page.  One is a normal url, the other is a javascript
postback.

On Jan 13, 10:20 pm, brian  wrote:
> You could maybe follow with not(). What are you trying to do?
>
> On Tue, Jan 13, 2009 at 5:26 PM, km...@fensys.com  wrote:
>
> > I'm using a attribute selector and I want to combine the *= with the !
> > = on href.  Is there any way to do this?


[jQuery] Re: Selector help

2009-01-13 Thread brian

You could maybe follow with not(). What are you trying to do?

On Tue, Jan 13, 2009 at 5:26 PM, km...@fensys.com  wrote:
>
> I'm using a attribute selector and I want to combine the *= with the !
> = on href.  Is there any way to do this?
>


[jQuery] Re: Selector Help

2008-11-26 Thread 徐显峰
yes it is

2008/11/26 Liam Potter <[EMAIL PROTECTED]>

>
> almost
>
> $('.link').click(function () {
>$(this).parent().BLAHBLAHBLAH();
> });
>
>
>
> Jason wrote:
>
>> Code:
>>
>> 
>> 
>> 
>>
>> 
>> 
>> 
>>
>> 
>> 
>> 
>>
>> When a link is clicked, I would like to be able to reference the
>> particular parent fieldset element, and not all of them.
>>
>> Something like this doesn't work:
>>
>> $('.link').click(function () {
>>$(this+':parent').BLAHBLAHBLAH();
>> });
>>
>> Thanks in advance, the help here is top notch!
>>
>>
>
>


[jQuery] Re: Selector Help

2008-11-26 Thread Liam Potter


almost

$('.link').click(function () {
$(this).parent().BLAHBLAHBLAH();
});



Jason wrote:

Code:













When a link is clicked, I would like to be able to reference the
particular parent fieldset element, and not all of them.

Something like this doesn't work:

$('.link').click(function () {
$(this+':parent').BLAHBLAHBLAH();
});

Thanks in advance, the help here is top notch!
  




[jQuery] Re: Selector Help

2008-11-25 Thread Jason

Excellent, thank you.

On Nov 25, 4:24 pm, "Charlie Griefer" <[EMAIL PROTECTED]>
wrote:
> On Tue, Nov 25, 2008 at 3:28 PM, Jason <[EMAIL PROTECTED]> wrote:
>
> > Code:
>
> > 
> > 
> > 
>
> > 
> > 
> > 
>
> > 
> > 
> > 
>
> > When a link is clicked, I would like to be able to reference the
> > particular parent fieldset element, and not all of them.
>
> > Something like this doesn't work:
>
> > $('.link').click(function () {
> >        $(this+':parent').BLAHBLAHBLAH();
> > });
>
> > Thanks in advance, the help here is top notch!
>
> $('.link').click(function () {
> $(this).parent()
>
> });
>
> so if you wanted to get the id of the parent  (assuming one
> existed), it'd be:
>
> $('.link').click(function () {
> alert($(this).parent().attr('id'));
>
> });
>
> --
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.


[jQuery] Re: Selector Help

2008-11-25 Thread Charlie Griefer
On Tue, Nov 25, 2008 at 3:28 PM, Jason <[EMAIL PROTECTED]> wrote:

>
> Code:
>
> 
> 
> 
>
> 
> 
> 
>
> 
> 
> 
>
> When a link is clicked, I would like to be able to reference the
> particular parent fieldset element, and not all of them.
>
> Something like this doesn't work:
>
> $('.link').click(function () {
>$(this+':parent').BLAHBLAHBLAH();
> });
>
> Thanks in advance, the help here is top notch!


$('.link').click(function () {
$(this).parent()
});

so if you wanted to get the id of the parent  (assuming one
existed), it'd be:

$('.link').click(function () {
alert($(this).parent().attr('id'));
});

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Selector help needed

2008-05-28 Thread Ariel Flesler

$('tr.child1 input.inputbox')

or just

$('tr.child1 input:text')

The last allows you to put aside the classes if you don't need them
for something else.
And actually, if you have no other inputs.. then you can remove
the  .inputbox / :text parts.

You should add type="text" to the inputs.

Cheers

--
Ariel Flesler
http://flesler.blogspot.com

On 28 mayo, 08:13, andyGr <[EMAIL PROTECTED]> wrote:
> I have fixed it as
>
> $j('tr.child1 td:eq(1) input')
>
> The only question is how to select ALL inputboxes valies of tr.child1. Now
> it selects only the 1st tr.child.
>
> Any ideas?
> --
> View this message in 
> context:http://www.nabble.com/Selector-help-needed-tp17508515s27240p17510366
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Selector help needed

2008-05-28 Thread andyGr


I have fixed it as

$j('tr.child1 td:eq(1) input')

The only question is how to select ALL inputboxes valies of tr.child1. Now
it selects only the 1st tr.child.

Any ideas?
-- 
View this message in context: 
http://www.nabble.com/Selector-help-needed-tp17508515s27240p17510366.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Selector help needed

2008-05-28 Thread PeterAce

did you try $(".child1 input[value=Gary]")?

On May 28, 11:51 am, andyGr <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> This is my DOM structure:
>
>         
>                         First Name:
>                          value="John" />
>         
>         
>                         Middle Name:
>                          value="Garry" />
>         
>         
>                         First Name:
>                          value="Nick" />
>         
>         
>                         Middle Name:
>                          value="Peter" />
> ...
>
> Questions:
>
> 1) how can I select the value Garry? I tried
>
> $('tr.child1 td input').eq(1).value
>
> But it does not work
>
> 2) How can I reset all values of input fields of tr.child2 without cycling
> through?
>
> Any help?
>
> --
> View this message in 
> context:http://www.nabble.com/Selector-help-needed-tp17508515s27240p17508515
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: selector help

2008-05-21 Thread Antonio Collins


Had to resort to 2 statements.  Still not sure why the filter() didn't work
as expected.

   $('TR[*/INPUT]',list).hide(); 
   $('TR[*/[EMAIL PROTECTED]',list).show();


Antonio Collins wrote:
> 
> My app has to present some rather lengthy list of choices.  Each choice
> has a checkbox tied to it and multiple choices can be made.
> 
> When 'editting' the choices, we want to see all available choices, but
> after editting is done, we only want to see what was selected.  I'm stuck
> coming up with the jQuery selector to display the user choices.  Something
> like this:.
> 
>$('TR',list).hide().filter(':has([EMAIL PROTECTED])').show();
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/selector-help-tp17369737s27240p17371300.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Selector help

2008-04-28 Thread Hamish Campbell

Hi hi,

':has' and ':not' are your friends:

$('#containerDiv tr:not(:has(div.taskSummary))')

On Apr 29, 1:26 pm, Shawn <[EMAIL PROTECTED]> wrote:
> Eventually got this working:
>
> $("tbody > tr", "#crewSchedule").each( function (pos) {
>    if ($(".taskSummary", this).length == 0) {
>      $(this).toggle();
>      $("#scheduleOutput .fixedTable table > tbody > tr:eq(" + pos +
> ")").toggle();
>    }
>
> });
>
> (the second .toggle() also hides the label for the current row, which
> resides in another table).
>
> This is still slowish though...  Luckily the clients are on decent
> computers.  But guess I have no choice but to do it this way - seeing as
> I need the position to match with the second table...
>
> Still, I'd appreciate any comments to improve this
>
> Shawn
>
>
>
> Shawn wrote:
>
> > I'm either making this more difficult than it is, or I'm missing
> > something simple...
>
> > I have a div that contains a table.  Inside that table I have rows with
> > an arbitrary number of cells.  The cells may or may not contain a div
> > with a "tasksummary" class.  I need to find all the rows that DO NOT
> > have a task summary div, and toggle them.
>
> > I can easily find the tasksummaries:
>
> > $("#containerDiv > table > tbody> tr .tasksummary");
>
> > But how do I change this to give me the TR's that don't have a task
> > summary div?  (note, some of the cells may contain sub tables, so the
> > explicit table>tbody>tr isolates only the main table...)
>
> > The only method I can see right now is to find the TRs then do a .each()
> > on them and check each row with the .hasClass().  But I'm sure there's
> > an easier way...
>
> > Thanks for any input.
>
> > Shawn- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: Selector help

2008-04-28 Thread Shawn


Eventually got this working:

$("tbody > tr", "#crewSchedule").each( function (pos) {
  if ($(".taskSummary", this).length == 0) {
$(this).toggle();
$("#scheduleOutput .fixedTable table > tbody > tr:eq(" + pos + 
")").toggle();

  }
});

(the second .toggle() also hides the label for the current row, which 
resides in another table).


This is still slowish though...  Luckily the clients are on decent 
computers.  But guess I have no choice but to do it this way - seeing as 
I need the position to match with the second table...


Still, I'd appreciate any comments to improve this

Shawn

Shawn wrote:


I'm either making this more difficult than it is, or I'm missing 
something simple...


I have a div that contains a table.  Inside that table I have rows with 
an arbitrary number of cells.  The cells may or may not contain a div 
with a "tasksummary" class.  I need to find all the rows that DO NOT 
have a task summary div, and toggle them.


I can easily find the tasksummaries:

$("#containerDiv > table > tbody> tr .tasksummary");

But how do I change this to give me the TR's that don't have a task 
summary div?  (note, some of the cells may contain sub tables, so the 
explicit table>tbody>tr isolates only the main table...)


The only method I can see right now is to find the TRs then do a .each() 
on them and check each row with the .hasClass().  But I'm sure there's 
an easier way...


Thanks for any input.

Shawn


[jQuery] Re: Selector help for new user please

2007-07-28 Thread duggoff

Thanks! I had to change .children to .find, but then it worked
great :)

Doug

On Jul 28, 1:51 pm, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> Doug,
> This should work, but untested:
>
> if($("div#sidebar2").children(".plugin").size() != 0{
>
> $("div#sidebar2").css('width',160);
> $("div#content")css('marginRight', 170);
>
> }
>
> On 7/28/07, duggoff <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > How would I turn this pseudocode into jquery?
>
> > if div#sidebar2 contains div.plugin {
> >   div#sidebar2 width = 160px
> >   div#content margin-right = 170px
> >   }
>
> > I've been at this for a couple hours and I can't figure it out, so any
> > help is really appreciated.
>
> > Thanks,
>
> > Doug
>
> --
> Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com



[jQuery] Re: Selector help for new user please

2007-07-28 Thread John Resig

That can be made much simpler:

if ( $("div#sidebar2[div.plugin]").width(160).length )
  $("div#content").css("marginRight", 170);

--John

On 7/28/07, Benjamin Sterling <[EMAIL PROTECTED]> wrote:
> Doug,
> This should work, but untested:
>
> if($("div#sidebar2").children(".plugin").size() != 0{
>
> $("div#sidebar2").css('width',160);
>
> $("div#content")css('marginRight', 170);
>
>
>
> }
>
>
>
> On 7/28/07, duggoff <[EMAIL PROTECTED]> wrote:
> >
> > How would I turn this pseudocode into jquery?
> >
> > if div#sidebar2 contains div.plugin {
> >   div#sidebar2 width = 160px
> >   div#content margin-right = 170px
> >   }
> >
> > I've been at this for a couple hours and I can't figure it out, so any
> > help is really appreciated.
> >
> > Thanks,
> >
> > Doug
> >
> >
>
>
>
> --
> Benjamin Sterling
> http://www.KenzoMedia.com
>  http://www.KenzoHosting.com


[jQuery] Re: Selector help for new user please

2007-07-28 Thread Benjamin Sterling
Doug,
This should work, but untested:

if($("div#sidebar2").children(".plugin").size() != 0{

$("div#sidebar2").css('width',160);
$("div#content")css('marginRight', 170);

}



On 7/28/07, duggoff <[EMAIL PROTECTED]> wrote:
>
>
> How would I turn this pseudocode into jquery?
>
> if div#sidebar2 contains div.plugin {
>   div#sidebar2 width = 160px
>   div#content margin-right = 170px
>   }
>
> I've been at this for a couple hours and I can't figure it out, so any
> help is really appreciated.
>
> Thanks,
>
> Doug
>
>


-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: Selector Help - hover and dblclick

2007-06-10 Thread Brad Perkins

Unbinding the hover and dblclick events when the row is double clicked
works nicely.

Now I've got another question. The customer wants to use double click
for row selection instead of a single click. One side-affect of using
double click is that doing so will select and highlight the text in
the row closest to the click. That is standard browser behavior. For
purely cosmetic reasons I'd like to suppress this.

Is there anyway to style an element so that its text is not
selectable?

Alternately, is there a way to detect and unselect selected text with
Javascript?

On Jun 10, 4:08 pm, Brad Perkins <[EMAIL PROTECTED]> wrote:
> Thanks for the suggestion. I'll give that a try.
>
> While I was away I was thinking about this and realized another
> solution might be to unbind the hover and dblclick events from the row
> when it is double-clicked.



[jQuery] Re: Selector Help - hover and dblclick

2007-06-10 Thread Brad Perkins

Thanks for the suggestion. I'll give that a try.

While I was away I was thinking about this and realized another
solution might be to unbind the hover and dblclick events from the row
when it is double-clicked.

On Jun 10, 1:49 pm, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Jun 11, 12:06 am, Brad Perkins <[EMAIL PROTECTED]> wrote:
>
>
> > Ultimately, I'd also like to prevent the double clicked row from
> > running code if previously double clicked.
>
>I suppose, you could do something like:
>
>if (this.done) return;
>and this.done=true; accordingly in the function. (Not tested)



[jQuery] Re: Selector Help - hover and dblclick

2007-06-10 Thread R. Rajesh Jeba Anbiah

On Jun 11, 12:06 am, Brad Perkins <[EMAIL PROTECTED]> wrote:
   
> Ultimately, I'd also like to prevent the double clicked row from
> running code if previously double clicked.

   I suppose, you could do something like:

   if (this.done) return;
   and this.done=true; accordingly in the function. (Not tested)

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Brad Perkins

Rafael,

That is what I had in mind, but appears to filter out non-radio input
fields.

On May 8, 2:00 pm, "Rafael Santos" <[EMAIL PROTECTED]> wrote:
> var params =
> $('input,select,textarea').not("[EMAIL PROTECTED]").serialize();
>
> 2007/5/8, Brad Perkins <[EMAIL PROTECTED]>:
>
> > I currently have this?
>
> > var params = $('input,select,textarea').serialize();
>
> > Is there a simple way to serialize all inputs expect for radio buttons?



[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Brad Perkins

Thanks everyone!

-- Brad

On May 8, 2:54 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Ah yes! You're right (as usual). :)
>
> --Karl
> _
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On May 8, 2007, at 4:54 PM, Jörn Zaefferer wrote:
>
>
>
> > Karl Swedberg schrieb:
> >> You could also do this:
>
> >> var params = $(':input:not(:radio)', 'form').serialize();
> > What about this:
>
> > var params = $('form :input:not(:radio)').serialize();
>
> > The extra context parameter isn't necessary.
>
> > --
> > Jörn Zaefferer
>
> >http://bassistance.de



[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Brad Perkins

That does the trick!

Thanks

On May 8, 2:05 pm, "John Resig" <[EMAIL PROTECTED]> wrote:
> Try this:
> var params = $("input,select,textarea").not(":radio").serialize();
>
> On 5/8/07, Brad Perkins <[EMAIL PROTECTED]> wrote:
>
>
>
> > I currently have this?
>
> > var params = $('input,select,textarea').serialize();
>
> > Is there a simple way to serialize all inputs expect for radio buttons?



[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Karl Swedberg

Ah yes! You're right (as usual). :)


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On May 8, 2007, at 4:54 PM, Jörn Zaefferer wrote:



Karl Swedberg schrieb:

You could also do this:

var params = $(':input:not(:radio)', 'form').serialize();

What about this:

var params = $('form :input:not(:radio)').serialize();

The extra context parameter isn't necessary.

--
Jörn Zaefferer

http://bassistance.de





[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Jörn Zaefferer


Karl Swedberg schrieb:

You could also do this:

var params = $(':input:not(:radio)', 'form').serialize();

What about this:

var params = $('form :input:not(:radio)').serialize();

The extra context parameter isn't necessary.

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Karl Swedberg

You could also do this:

var params = $(':input:not(:radio)', 'form').serialize();

:)


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On May 8, 2007, at 4:00 PM, Rafael Santos wrote:

var params = $('input,select,textarea').not("input 
[EMAIL PROTECTED]").serialize();


2007/5/8, Brad Perkins <[EMAIL PROTECTED]>:

I currently have this?

var params = $('input,select,textarea').serialize();

Is there a simple way to serialize all inputs expect for radio  
buttons?





--
Rafael Santos Sá :: webdeveloper
www.rafael-santos.com




[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread John Resig


Try this:
var params = $("input,select,textarea").not(":radio").serialize();

On 5/8/07, Brad Perkins <[EMAIL PROTECTED]> wrote:


I currently have this?

var params = $('input,select,textarea').serialize();

Is there a simple way to serialize all inputs expect for radio buttons?




[jQuery] Re: Selector help - All inputs except radio buttons?

2007-05-08 Thread Rafael Santos

var params =
$('input,select,textarea').not("[EMAIL PROTECTED]").serialize();

2007/5/8, Brad Perkins <[EMAIL PROTECTED]>:



I currently have this?

var params = $('input,select,textarea').serialize();

Is there a simple way to serialize all inputs expect for radio buttons?





--
Rafael Santos Sá :: webdeveloper
www.rafael-santos.com