[jQuery] Re: Selector and fadeIn/Out problem! (need help)

2009-12-30 Thread Dan Krusi
Hey, If you are trying to get the parent of the 'close' button and fade that out, just use one of the following: closest( expr ) parent( [expr] ) $(document).bind("click", function (e) { $(e.target).closest("li").toggleClass("hilight"); // will traverse the clicked element returning the fi

[jQuery] Re: Selector fails and works

2009-12-09 Thread B Ruml
Brian: Thank you *so* much for your help with this! I found that I could even do: $('#selected_courses input:radio:checked[name="' + curr_ordinal + '"]') I'm skeptical about your explanation of the value for checked because: 1) in Firebug's DOM inspector the value shown for the Javascript pr

Re: [jQuery] Re: Selector issue

2009-12-04 Thread Karl Swedberg
The .live() method uses event delegation under the hood. doing this: $('a').live('click', function() { // do something }); is like doing this: $(document).bind('click', function(event) { if ($(event.target).closest('a').length) { // do something } }); except that with .live() the sel

[jQuery] Re: Selector issue

2009-12-04 Thread MorningZ
> Nah. Using .live() wires up one event handler to document. > > --Karl Doh, shame on me for my lack of facts on that ".live()"... i'll read up on it some, as i usually, well always, take the delegation route..

[jQuery] Re: Selector issue

2009-12-04 Thread Civette
Well I dont think I'll have more than about 15 childs here. Thx for help On 4 déc, 17:09, MorningZ wrote: > I wouldn't suggest going the ".live" route if you plan on having a lot > of children of "cat_list" > > using event delegation, there is one single event wired up that > handles 1 child

Re: [jQuery] Re: Selector issue

2009-12-04 Thread Karl Swedberg
On Dec 4, 2009, at 11:09 AM, MorningZ wrote: I wouldn't suggest going the ".live" route if you plan on having a lot of children of "cat_list" using event delegation, there is one single event wired up that handles 1 child or 1200 children using ".live", you would have N number of events s

[jQuery] Re: Selector issue

2009-12-04 Thread MorningZ
I wouldn't suggest going the ".live" route if you plan on having a lot of children of "cat_list" using event delegation, there is one single event wired up that handles 1 child or 1200 children using ".live", you would have N number of events sitting there wired up where N is the number of ch

[jQuery] Re: Selector issue

2009-12-04 Thread Civette
Well, after a few tests, this works fine : $("#cat_list > div").live("click", function() { alert($(this).attr("id")); }); thanx

[jQuery] Re: Selector issue

2009-12-03 Thread Civette
Is your issue description linked to this : http://forum.jquery.com/viewtopic.php?f=2&t=1000&sid=7932d86732f0126e2c4ad3f5e92baa4d Same thing ? On Dec 3, 10:52 pm, MorningZ wrote: > if those 's are dynamically added, which it sounds like is the > case, then the "new" 's do not get wired automati

[jQuery] Re: Selector issue

2009-12-03 Thread Civette
I'll test it tomorrow. Thx for answer

[jQuery] Re: Selector issue

2009-12-03 Thread MorningZ
if those 's are dynamically added, which it sounds like is the case, then the "new" 's do not get wired automatically... <- this is easily the most common trip-up seen on this mailing list Event Delegation would be your friend here http://jsbin.com/ivivo/edit that way the container event "cat_

[jQuery] Re: Selector issue

2009-12-03 Thread Civette
Well, actually my div "39", "40", are returned in the cat_list div from a previous ajax query. Numbers are in fact the autoincrement id's in a mysql table. Point is, on clicking each, to edit it. That specific javascript part is returned by that ajax query.

[jQuery] Re: Selector issue

2009-12-03 Thread MorningZ
the first one works perfectly fine in stripped down form http://jsbin.com/epoju/edit must be something else with other code you are doing On Dec 3, 10:03 am, Civette wrote: > Well i'm in trouble. > > Following code does not trigger : > > Code: Select all >     $("#cat_list > div").click(functi

[jQuery] Re: Selector issue

2009-12-03 Thread RiccardoC
I'm relative new to jQuery, but I usually use "function(e)" instead of "function()" within a "click" handlers, because when you do it on a selector that do not return a single element ("#cat_list > div" returns several dom element) you cannot access the data you need (e.target is the element you cl

[jQuery] Re: selector performance

2009-11-12 Thread RobG
On Nov 12, 6:11 am, Karl Swedberg wrote: > Are those tests really using jQuery 1.1.4? If so, they're hardly   > relevant now, unless you're using a very old version of jQuery. The "tests" are relevant in the context of the article. The point is really about improving performance by not making c

Re: [jQuery] Re: selector performance

2009-11-11 Thread Karl Swedberg
Are those tests really using jQuery 1.1.4? If so, they're hardly relevant now, unless you're using a very old version of jQuery. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 11, 2009, at 7:23 AM, grabnerandi wrote: Check out this link: http://blog

[jQuery] Re: selector performance

2009-11-11 Thread grabnerandi
Check out this link: http://blog.dynatrace.com/2009/11/09/101-on-jquery-selector-performance/

[jQuery] Re: Selector and special characters

2009-09-29 Thread MorningZ
Is changing the name values a possibility? You're doing nothing but asking for trouble (overly complicated selector syntax and poor performance) with your current naming convention On Sep 29, 9:14 am, loicg wrote: > Hi, > > I want all my form inputs which name start with "fieldInstanceGroups >

[jQuery] Re: Selector bind help

2009-09-09 Thread Justin
After you have bound your keyup action you can add another triggering event like so: $('#Query').bind('change', function(){ $(this).trigger('keyup'); }) On Sep 9, 3:36 pm, "Dave Maharaj :: WidePixels.com" wrote: > I have a simple form field that runs a query. > > I have > > $('#Query').bind('

[jQuery] Re: selector behaviour in IE6

2009-08-27 Thread James
NAME is not valid attribute of , so it's possible you can expect some inconsistencies. I suggest changing it to using ID instead (remember, IDs cannot begin with a number also, so you'll have to prepend it with something). Other suggestions are using jQuery's data() functions: http://docs.jquery.

[jQuery] Re: Selector question

2009-07-29 Thread lukas
Thank you for your immediate response, Hector and Brett! I love the jquery group!

[jQuery] Re: Selector question

2009-07-29 Thread Brett Ritter
On Wed, Jul 29, 2009 at 4:23 PM, lukas wrote: > How can I pick an id element (here #bridge1,#bridge2) and toggle its > child (here a p element) without actually using the id element as > parent? > 'this > p' apparently does not work. $(this).children("p") It only checks immediate children (as wi

[jQuery] Re: Selector question

2009-07-29 Thread Hector Virgen
Within your click function, "this" refers to the element that was clicked (in this case, either #bridge1 or #bridge2). You can then get the (immediate) children of that element that match the selector 'p' and toggle that. $('#bridge1,#bridge2').click(function(){ $(this).children('p').toggle

[jQuery] Re: Selector help needed

2009-07-24 Thread Michael Lawson
From: iceangel89 To: "jQuery (English)" Date: 07/24/2009 09:24 AM

[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: > >
    >    
  • Link 1
  • >    
  • >         Link 2 >        
      >        

[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'),

[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

[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

[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')

[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 tr

[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

[jQuery] Re: Selector :eq(x) issuing warning in FF

2009-07-02 Thread Mauricio (Maujor) Samy Silva
I run a local test with your code here and it works fine! Maurício -Mensagem Original- De: Shane Riley Para: jQuery (English) Enviada em: quinta-feira, 2 de julho de 2009 13:12 Assunto: [jQuery] Selector :eq(x) issuing warning in FF When calling this jQuery: $("#homepag

[jQuery] Re: Selector Syntax, new to jQuery

2009-07-02 Thread NauticalMac
Answering my own question. Missed the optional 'context' parameter on the basic jQuery command. Works as advertised/expected. On Jul 2, 6:39 am, NauticalMac wrote: > Starting to use jQuery having read 'jQuery in Action'. > Came across the following sysntax for sortable tables: >   $('table.sort

[jQuery] Re: Selector Syntax, new to jQuery

2009-07-02 Thread Charlie
 I've been around jQuery for about 6 months and only learned that syntax  recently. You won't find it documented very many places, perhaps it's an older style that got phased out for more aesthetic chaining. It is in jQuery core and it does work NauticalMac wrote: Starting to use jQuery ha

[jQuery] Re: selector, second to last row of table

2009-06-20 Thread Paul Witschger
ok, go to http://www.hypertextwebdesign.com/admin, click the button that shows up (placeholder for login form) Click on Galleries on the menu on the left What shows next is the main galleries page. Here the client can sort the galleries how they want them to be sorted on their website, delete

[jQuery] Re: selector, second to last row of table

2009-06-20 Thread Ricardo
What exactly are you trying to achieve? It's hard to deduce anything from lots of .prev() and .next() calls without seeing the corresponding HTML mark-up. What inner DIV? What container? Moving a single row up should be as simple as $row.insertBefore ( $row.prev() ); http://snipt.org/kkpo On Jun

[jQuery] Re: selector, second to last row of table

2009-06-18 Thread Paul Witschger
This code seems to work great in FF and Safari, but IE seems to interact with it differently. [code] $('a.moveup').click(function(event) { var href = $(this).attr('href'); $.get(href); var $thisRow = $(this).parents('tr:first'); var $thisTable = $('#main_table');

[jQuery] Re: selector, second to last row of table

2009-06-17 Thread ggerri
Hi just want to share my piece of code for getting out values of rows/ cells. $('#myTableID tr:gt(1)').each(function(){ $(this).find('td').each(function(){ // get the cell text out with $.trim($(this).text()); }); }); hope that helps Gerald On Jun 17, 7:08 pm, theprodigy

[jQuery] Re: selector, second to last row of table

2009-06-17 Thread theprodigy
I think I have it working now. It does what it's supposed to, but doesn't really seem to me that it would be all the effecient, should a table have lots of rows (unlikely, but may happen). Here is my code: $('a.moveup').click(function(event) { //Send request to server var href

[jQuery] Re: selector, second to last row of table

2009-06-16 Thread RobG
On Jun 17, 3:46 am, theprodigy wrote: > I've been trying for a while to alter the second to last row of a > table. I've tried several ways. The number of rows is dynamic so I > can't hard code a number into nth-child. I used $rowNeeded = > $thisRow.parents('table:first').children().children().l

[jQuery] Re: selector, second to last row of table

2009-06-16 Thread theprodigy
ok, I'm having a really tough time with this. here's a part of my code (most of this Thanks to Karl, part thanks to mkmanning, very little thanks to me, lol): $('a.moveup').click(function(event) { var $thisRow = $(this).parents('tr:first'); var $thisTable = $('#main_table');

[jQuery] Re: selector, second to last row of table

2009-06-16 Thread mkmanning
A couple quick examples that might help (there're many more ways): console.log( $('table tr:last').prev() ); var trow = $('table tr'); console.log( $(trow[trow.length-2]) ); console.log( trow.eq(trow.length-2) ); Modify the selectors as needed for multiple/nested tables. HTH On Jun 16, 10:46 

[jQuery] Re: selector strangeness -- is this a bug or am I doing it wrong?

2009-06-11 Thread morgancodes
Hi, no responses to this, so thought I'd reply to put it in front of people again. Perhaps an item for the jquery dev list? thanks, -Morgan On Jun 10, 4:57 pm, morgancodes wrote: > Hello, > > I'm getting inconsistant results across browsers with the following > test: > > test.html =

[jQuery] Re: selector question

2009-06-09 Thread mkmanning
Yes you do, if you want to filter by ID. Unless the variable pid = "#some_id". On Jun 9, 1:29 pm, Danny wrote: > You probably don't want the '#' character in there: > $("div:not("+pid+") form span").css("background-color","yellow"); > > On Jun 9, 11:45 am, mkmanning wrote: > > > > > $("div:not(

[jQuery] Re: selector question

2009-06-09 Thread Danny
You probably don't want the '#' character in there: $("div:not("+pid+") form span").css("background-color","yellow"); On Jun 9, 11:45 am, mkmanning wrote: > $("div:not(#"+pid+") form span").css("background-color","yellow"); > > On Jun 9, 8:19 am, squalli2008 wrote: > > > Hi, > > > Im trying to

[jQuery] Re: selector question

2009-06-09 Thread mkmanning
$("div:not(#"+pid+") form span").css("background-color","yellow"); On Jun 9, 8:19 am, squalli2008 wrote: > Hi, > > Im trying to select all spans in divs containing forms that dont have > a certain id > > $("div:not([id='#'+pid]) form span").css("background-color", > "yellow"); > > This selec

[jQuery] Re: Selector not question

2009-06-04 Thread Mauricio (Maujor) Samy Silva
$('a[class^="edit_"]:not(.' + e + ')').fadeTo('slow' , 0.25 , function() { ... } Maurício -Mensagem Original- De: Dave Maharaj :: WidePixels.com Para: jquery-en@googlegroups.com Enviada em: quinta-feira, 4 de junho de 2009 21:43 Assunto: [jQuery] Selector not question I am

[jQuery] Re: Selector not question

2009-06-04 Thread Mauricio (Maujor) Samy Silva
-Mensagem Original- De: Dave Maharaj :: WidePixels.com Para: jquery-en@googlegroups.com Enviada em: quinta-feira, 4 de junho de 2009 21:43 Assunto: [jQuery] Selector not question I am trying to disable all links except for the one clicked. $('a[class^="edit_"]').click(f

[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

[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['nam

[jQuery] Re: Selector help needed

2009-04-28 Thread Jeffrey Kretz
t 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

[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 ha

[jQuery] Re: Selector questions

2009-04-17 Thread Karl Swedberg
On Apr 16, 2009, at 8:26 AM, Dragon-Fly999 wrote: Instead of using "$(this).parent().parent().find(':checkbox')", is there a way to select using the following rule: Go up the hierarchy (regardless of how many parents there are) until the first is found, then give me a list of all the checkbox

[jQuery] Re: Selector questions

2009-04-16 Thread Dragon-Fly999
I didn't know about the closest method and I could use it in my case. Thank you. On Apr 16, 8:33 am, Leonardo K wrote: > Maybe is easier if you put a class (wrapper) in your div that wrap all other > divs, and then you could use: > > $(this).closest('div.wrapper').find(":checkbox"); > > and > >

[jQuery] Re: Selector questions

2009-04-16 Thread Leonardo K
Maybe is easier if you put a class (wrapper) in your div that wrap all other divs, and then you could use: $(this).closest('div.wrapper').find(":checkbox"); and $(this).closest('div.wrapper').prev(); On Thu, Apr 16, 2009 at 09:26, Dragon-Fly999 wrote: > > Thanks, Karl. Your suggestions work f

[jQuery] Re: Selector questions

2009-04-16 Thread Dragon-Fly999
Thanks, Karl. Your suggestions work fine. I just started using JQuery and found the selectors very powerful. I was wondering if the selectors that you suggested can be less dependent on the number of divs in that section of the HTML. Instead of using "$(this).parent().parent().find(':checkbox'

[jQuery] Re: Selector questions

2009-04-15 Thread Karl Swedberg
On Apr 15, 2009, at 6:24 PM, Dragon-Fly999 wrote: Hi, I have a couple of questions about selectors. I have the following HTML: = Some elements and elements here. ... ... Information Type 1 First Middle Last ... ... More elements and elements here. = Q

[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Josh Rosenthal
Hi Stephan, Interesting. You're also right that I could separate out the layerType check. I'm using a OCG WMS to fetch a small block of KML objects surrounding a point (geoserver WMS with KML output). In response to a user query, I loop through the collection checking if the query coord is insid

[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Stephan Veigl
Hi Josh, it looks like $foo.find(":header") has a problem since there is no single root element. Wrapping your data packet into would help: $foo = $(""+foo+""); but since you are after a speed optimization I would suggest: layerType = $(queryTarget[0]).text(); This gets the text of your fir

[jQuery] Re: Selector Efficiency?

2009-03-01 Thread Josh Rosenthal
Hi Stephen, My apologies for not getting back to you sooner. I've been sick and my projects have gotten away from me. We now return to the email I'd started writing before I lost track of everything. Thank you! Trebly so! First, yes, the data is ordered based on a template in geoserver th

[jQuery] Re: ~ selector is not selecting siblings

2009-02-25 Thread ricardobeat
There must be something else wrong in your page. The HTML and selectors you gave work fine (see http://jquery.nodnod.net/cases/175). Can you put a complete sample page online? - ricardo On Feb 25, 8:52 pm, RadicalBender wrote: > The rows are created on the fly, they aren't actually empty.  Here

[jQuery] Re: ~ selector is not selecting siblings

2009-02-25 Thread RadicalBender
The rows are created on the fly, they aren't actually empty. Here's a simplified version of what the table looks like:  ArtistSong There are no songs yet. Artist NameSong Title Artist NameSong Title Artist NameSong Title As you can see, there's a header row, then the NoSongs row, then all of

[jQuery] Re: ~ selector is not selecting siblings

2009-02-25 Thread Mauricio (Maujor) Samy Silva
Hi RadicalBender, How about use the $('tr td:empty') selector to target the empties rows? Not solve? So, need some more information to try figure out a solution. Are there tbody, tfoot and thead in your table? Where is located the tr#NoSongs? Would you please show a simplified sample of the ta

[jQuery] Re: Selector Efficiency?

2009-02-19 Thread Stephan Veigl
Hi Josh, are your data ordered? (e.g. MAP_ID is the first , SITE_ADDRESS the second, ...) If yes you can use a index based approach (from 4.8ms to 0.9ms on IE). var $foo = $(foo); var data = $foo.find(".atr-value"); var parcelOutput = 'Parcel ID: ' + $(data[0]).text() + '' +

[jQuery] Re: selector best practice

2009-02-18 Thread Henrik Javén
Your test case is not comparing a raw implementation You are still using jQuery $ inside the loop, it should be pure document.getElementById("test"); When you remove the $ from your test case and use native implementation you will be getting numbers in the following range: FF ID Raw: 1 ID jQuer

[jQuery] Re: selector best practice

2009-02-17 Thread RobG
On Feb 17, 4:22 pm, SteelRing wrote: > I would love to get to the bottom of all these and figure out cases of > "recommended" and "bad" uses of jquery selector. I came across jquery > a couple months ago and got excited with how easy it is to use this > framework rather than doing getElementFro

[jQuery] Re: selector best practice

2009-02-16 Thread SteelRing
I would love to get to the bottom of all these and figure out cases of "recommended" and "bad" uses of jquery selector. I came across jquery a couple months ago and got excited with how easy it is to use this framework rather than doing getElementFromMyAss all over the page, typing that long synta

[jQuery] Re: selector best practice

2009-02-16 Thread RobG
On Feb 17, 2:43 am, John Resig wrote: > On Mon, Feb 16, 2009 at 8:28 AM, RobG wrote: > > > On Feb 16, 5:30 pm, SteelRing wrote: > >> This may sound stupid to y'all jquery practitioners, but i wonder > >> which method is fastest (recommended) for selecting a cell with a > >> class in a big ta

[jQuery] Re: selector best practice

2009-02-16 Thread John Resig
Umm - that's not true at all. I created a test for you to see: http://dev.jquery.com/~john/ticket/class-speed/ In Firefox 3 I'm getting: ID Raw: 9 ID jQuery: 22 (over 500 queries) Class Raw: 1108 Class jQuery: 778 (over 100 queries) In Safari 3.2 I'm getting: ID Raw: 1 ID jQuery: 3 (over 500 qu

[jQuery] Re: selector best practice

2009-02-16 Thread Ricardo Tomasi
Not going to native methods I'd say the fastest selector without an ID would be $("#tableid td.cellclass") as that will call getElementByID and getElementsByTagName/getElementsByClassName from the #tableid context (or querySelectorAll). Anyway, you only need to add more selectors if you want to en

[jQuery] Re: selector best practice

2009-02-16 Thread RobG
On Feb 16, 5:30 pm, SteelRing wrote: > This may sound stupid to y'all jquery practitioners, but i wonder > which method is fastest (recommended) for selecting a cell with a > class in a big table (think like 1000+ rows 100+ columns): Fastest: the browser-native getElementsByClassName (recent

[jQuery] Re: selector best practice

2009-02-15 Thread Rene Veerman
I'd say go for just ("#uniqueid") as that likely maps to document.getElementById() (fast) and bypasses the normal jquery traversing that is required if you put in more selectors. SteelRing wrote: This may sound stupid to y'all jquery practitioners, but i wonder which method is fastest (recom

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-10 Thread mkmanning
rowIndex is a DOM property, so you'd have to use alert(trow [0].rowIndex); On Feb 10, 10:19 am, pantagruel wrote: > >  rowsBefore = row.rowIndex; > > Ok, but jQuery("#activator" + input).parent().parent(); selects the > row, but when I try to get rowIndex of that selected row I get > undefined b

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-10 Thread James
Try: alert( trow.get(0).rowIndex ); On Feb 10, 8:19 am, pantagruel wrote: > >  rowsBefore = row.rowIndex; > > Ok, but jQuery("#activator" + input).parent().parent(); selects the > row, but when I try to get rowIndex of that selected row I get > undefined back. > > var trow = jQuery("#activator"

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-10 Thread pantagruel
> >  rowsBefore = row.rowIndex; Ok, but jQuery("#activator" + input).parent().parent(); selects the row, but when I try to get rowIndex of that selected row I get undefined back. var trow = jQuery("#activator" + input).parent().parent(); alert(trow.attr("class")); // the class of my row alert(

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-09 Thread Nivash Ramachandran
Great discussion. Thanks for all. -- Nivash Ramachandran On Mon, Feb 9, 2009 at 7:19 PM, Karl Swedberg wrote: > Oh yeah! Good point, Rob. I always forget these DOM properties. Thanks for > the reminder. :) > > --Karl > > > Karl Swedberg > www.englishrules.com > www.learningjquery.co

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-09 Thread Karl Swedberg
Oh yeah! Good point, Rob. I always forget these DOM properties. Thanks for the reminder. :) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 9, 2009, at 2:37 AM, RobG wrote: On Feb 9, 4:23 am, pantagruel wrote: Hi, I am selecting the row of a tab

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread RobG
On Feb 9, 4:23 am, pantagruel wrote: > Hi, > > I am selecting the row of a table. I would like to be able to count > how many rows there are in the table before the row I just selected. i > suppose there is a jQuery selector that will do this. Not necessary - table rows have a rowIndex propert

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread Karl Swedberg
Oops. Sorry, I didn't see Ricardo's reply before posting. In any case, there's no need to filter the .prevAll() with 'tr', since no other element is allowed as a sibling of a tr. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 8, 2009, at 6:06 PM, Kar

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread Karl Swedberg
You could use prevAll() $('#myrow').prevAll().length; --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 8, 2009, at 2:30 PM, James wrote: I did a search but I could only find a selector that selected "after" something: http://docs.jquery.com/Selectors/s

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread Ricardo Tomasi
you should be looking at http://docs.jquery.com/Traversing var currentRow = $('table tr').eq(7); var howManyBefore = currentRow.prevAll('tr').length; cheers, - ricardo On Feb 8, 3:23 pm, pantagruel wrote: > Hi, > > I am selecting the row of a table. I would like to be able to count > how many

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread James
I did a search but I could only find a selector that selected "after" something: http://docs.jquery.com/Selectors/siblings#prevsiblings can help. Maybe you can get the total rows count, subtract from the count from prev ~ siblings (and probably subtract 1 also). I hope that helps somewhat. On Fe

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread James
Oops, I misread. You wanted the count "before" the one you selected. Please disregard my response! On Feb 8, 9:22 am, James wrote: > Assuming "row" means the number of , > and your tables looks like: > >      data >      data >      data >      data >      data > > >  you can do something like

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread James
Assuming "row" means the number of , and your tables looks like: data data data data data you can do something like: var count = $("table tr").length; http://docs.jquery.com/Core/length On Feb 8, 8:23 am, pantagruel wrote: > Hi, > > I am selecting the row of a table

[jQuery] Re: selector finds element but changing css has no effect?

2009-02-05 Thread Olaf Bosch
pantagruel schrieb: try this: My code is the following fragment: var currentelement = jQuery("#" + activecolid); var selectedcontent = jQuery("#" + activecolid).find ("div.contentdisplay").css({border: "10px solid #699000"}); alert(currentelement.html()); alert(selectedcontent.html());

[jQuery] Re: selector for children of specific element?

2009-01-25 Thread ChrisA
Karl, My solution appears to be along the line of: var elem = getdocument... $(elem).children() ... I hadn't realized that I can pass a DOM element as a selector. Thanks, Chris

[jQuery] Re: selector for children of specific element?

2009-01-24 Thread Karl Swedberg
How about .children() ? For example: $('tr').children() That, and much, much more, can be found at http://docs.jquery.com/Selectors --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 24, 2009, at 5:20 PM, ChrisA wrote: I need to run thru a table and

[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')) { >

[jQuery] Re: $(selector).add($(.next))

2009-01-18 Thread Ami
Thank you. This is exactly what I search. 10 Points :) On Jan 19, 4:45 am, Ricardo Tomasi wrote: > The only alternative is > > $(selector).next().andSelf() > > On Jan 19, 12:08 am, Ami wrote: > > > Hello, > > > Sorry about my grammar, English isn't my tang. > > > How I add to $ the next elmem

[jQuery] Re: $(selector).add($(.next))

2009-01-18 Thread Ricardo Tomasi
The only alternative is $(selector).next().andSelf() On Jan 19, 12:08 am, Ami wrote: > Hello, > > Sorry about my grammar, English isn't my tang. > > How I add to $ the next elmement. > > Some think Like > > I can do: > $(selector).add( $(selector).next) > > But I think that there is a better so

[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'); > >  

[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'; $te

[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

[jQuery] Re: Selector *= not works in Safari 3.2.1 and Chrome 1.0.154.43

2009-01-16 Thread John Resig
What version of jQuery are you using? --John On Fri, Jan 16, 2009 at 2:35 AM, floyd wrote: > > Hi all, > Here is my situation. > > HTML Page DTD Type is declared as following > > http://www.w3.org/ > TR/xhtml11/DTD/xhtml11.dtd"> > > Javascript Code as following > > $("#fp > option[text*='"+su

[jQuery] Re: Selector Question from a newb

2009-01-15 Thread Balazs Endresz
If you are using 1.3 it might be related to this: http://dev.jquery.com/ticket/3848 Anyway, if you select by ID then you don't need any other selectors as IDs are unique. On Jan 15, 7:06 pm, John wrote: > This has probably been asked several times on the list but I'm having > trouble finding a

[jQuery] Re: Selector Question from a newb

2009-01-15 Thread Karl Swedberg
On Jan 15, 2009, at 1:06 PM, John wrote: This has probably been asked several times on the list but I'm having trouble finding a resolution. Yes. In fact, it has been asked frequently. :) http://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_event_work_on_a_new_element_I.27ve_cre

[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 + ']') .e

[jQuery] Re: Selector Question

2009-01-14 Thread bittermonkey
Got it. Thanks Mike. So this code would have made better sense: $("button:first").click(function(event){alert(this);}) On Jan 13, 5:52 pm, "Michael Geary" wrote: > Do you have Firebug? If not, get it and enable the Console and Script tabs, > then enter these statements into the console input

[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

[jQuery] Re: Selector problem with $( "a[ajax\\:id='46']" )

2009-01-14 Thread jQuery Lover
Duplicate. See: http://groups.google.com/group/jquery-en/browse_thread/thread/e47ce13098a16ef/606e652153c624a2#606e652153c624a2 - Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Jan 14, 2009 at 3:32 PM, naden wrote: > > I'm using jQuery 1.2.6 and having a

  1   2   3   >