selectors

jQuery: Trying to write my first plugin, how can I pass a selector to my func?

Hi, I am trying to start writing some simple jQuery plugins and for my first try if figured I would write something that does nothing else but apply .first & .last classes to passed elements. so for instance i want to ultimately be able to: $('li').firstnlast(); So that in this html structure: <ul> <li></li> <li></li> <...

jQuery child selector expression

<div id="div"> <div> <!-- first level --> <div> <!-- second level --> <div>1.1</div> <!-- third level --> <div>1.2</div> </div> <div> <div></div> <div>2.2</div> </div> </div> </div> What are the jQuery selector expressions for selecting the followin...

Jquery persistent css selector equivalent to '.live()'

So today I just came across the 'live()' function that binds any future and past elements to the whatever event you choose, such as 'onclick'. Right now I'm having to set up buttons like the following each time I load a new button via ajax ... $('a.btn.plus').button({icons:{primary:'ui-icon-plusthick'}}); $('a.btn.pencil').button({icon...

On select show multiple divs?

Hi I am trying when a user chooses an airline from dropdown seen here that two additional drop downs appear for departing airport and arrival airport. I have coded it to work when one chooses American Airlines from drop down, but I need different departing and arrival airports to appear for the various a user may choose. Anyone know ...

Why does document.querySelectorAll return a StaticNodeList rather than a real Array?

It bugs me that I can't just do document.querySelectorAll(...).map(...) even in Firefox 3.6, and I still can't find an answer, so I thought I'd cross-post on SO the question from this blog: http://blowery.org/2008/08/29/yay-for-queryselectorall-boo-for-staticnodelist/ Does anyone know of a technical reason why you don't get an Array? ...

iPhone: Passing values through a @selector funcion

I need help with an Xcode script, and was wondering if anyone can help me solve this. Lets say that I created these fields, "UITextField *titleField" & "UITextField *tagsField" directly within a table cell. And the "UIBarButtonItem *saveMyContentButton" below calls a function "saveMyContent". When I run the app I get the two commented e...

Descendent or self selector in jQuery

I want to search for all elements with class needle in all elements returned by jQuery('.haystack') and have tried jQuery('.haystack .needle'), but this doesn't seem to pick up the case where an element has both classes. Is there a selector that will do this? ...

jQuery: Selecting all elements where attribute is greater than a value

I know that to filter an element with an atttribute called attrName which has value attrValue I do: filter("[attrName='attrValue']") but looking at the docs http://api.jquery.com/category/selectors/ I can't see an option to select all elements s.t. attrName>attrValue Will this work filter("[attrName>'attrValue']") ...

Parse HTML with CSS or XPath selectors?

My goal is to parse HTML with lxml, which supports both XPath and CSS selectors. I can tie my model properties either to CSS or XPath, but I'm not sure which one would be the best, e.g. less fuss when HTML layout is changed, simpler expressions, greater extraction speed. What would you choose in such a situation? ...

jQuery - How to select elements that do NOT have a class?

How do I get elements that do not have any class names? <td class="B A">A03<sub>reserved</sub></td> <td class="B R">R70</td> <td>105</td> <td class="M C">L220</td> Right now I'm doing this $('td').not('.A, .B, .C, .M, .R') There's gotta be a better way! ...

jQuery: select all DIV's nested under specific DIV

I have an architecture similar to this: <div id="container"> <div>stuff here</div> <div>stuff here</div> <div>stuff here</div> <div>stuff here</div> </div> I want to, using jQuery, hide the cursor when the mouse enters #container. However as the nested divs appear on top it doesn't quite work that way. How can I hide the mouse curso...

JQuery: Selector that contains some text, but doesn't contain others

Sorry if this question is mind numbingly easy to answer, but I'm a bit new to JQuery and I have a tight deadline. I am looking for a selector for textbox elements that have this format: id = "FixedName_#" "FixedName" will always be "FixedName", but I only want to find elements where the # is positive. So I would want to find "FixedNa...

Page with 1 iFrame, how do u access the iFrame when you don't know the name or ID - w JQUERY

Given an html page with: <iframe frameborder="0" allowtransparency="true" tabindex="0" src="" title="Rich text editor, editor_kama, press ALT 0 for help." style="width: 100%; height: 100%;"><html><body><p>replace me</p></body></html></iframe> How can I access the iframe assuming I can't give the iFrame a name or ID since it's made dyn...

IE8 CSS selector selects, but does not apply the style.

This is making me want to kill myself. I have some really simple CSS to style my input objects: input, button { border: 1px solid #c66600; background-color: white; color: #7d212f; font-family: "Eras Light ITC", Tahoma, sans; } But I don't like the ugly border it puts around radio buttons, s...

Jquery - $(this) in nested loops

Hi, I can't figure out how to do something in Jquery. Let's say I have a form with many select drop-downs and do this... $('#a_form select').each(function(index) { }); When inside this loop I want to loop over each of the options, but I can't figure out how to do this, is it something like this....? $('#a_form select').each(fu...

hidden row causing issue with tablesorter zebra striping

Sorry if this has already been solved elsewhere but my searches have been able to turn up nothing and my attempts at solving the issue myself have made even less progress. :P Put quite simply I have a table that is using the jquery tablesorter and it's zebra widget. In this table there is a hidden column. I've so far been able to make i...

jQuery Selectors - where item does not have children with a certain class

I want to select list items that are immediate children of #nav, that do not themselves have immediate children with an 'active' class. This is what I think it should be but it does not work: $('#nav > li:not(> a.active)') ...

Changing A Different Class Display on Hover with Jquery

Ok, here's what I'm trying to do. I have a DIV box with a child element set with DISPLAY: NONE;. I'm trying to use Jquery so that when the mouse enters the parent DIV box, the child element is made visible, and then hides when the mouse leaves the parent DV. There will be multiple divs on the page with these classes. For some reason it's...

jquery select one class from many

Hi, I'm trying to achieve the following functionality. Within a form I have multiple fields with the class name .inputField if one of these fields is selected then the div associated with that element should be shown on focus and hidden on blur. However, when I implement the code below on selecting the second element the class is appl...

SEL performSelector and arguments

Hello, It seems like there should be an easy way to call a selector with some arguments when all you have is a SEL object. I can't seem to find the correct syntax. -(MyClass*) init: (SEL)sel owner:(NSObject*) parent { int i =10; [parent performSelector:sel:i ]; } ...